如何安装在VB.NET在用户机器上的字体,以便像Word应用程序可以使用它?应用程序、字体、用户、安装在

由网友(墨迹得先森°)分享简介:需要安装上的所有用户的机器上的字体,将使用我写的应用程序,它在Word中创建自定义的文件。这是一间酒吧code字型。Need to install a font on all user's machines that will use the application I am writing which create...

需要安装上的所有用户的机器上的字体,将使用我写的应用程序,它在Word中创建自定义的文件。这是一间酒吧code字型。

Need to install a font on all user's machines that will use the application I am writing which creates custom documents in Word. It's a barcode font.

我已经成功地将字体为我的解决方案,并将其生成操作嵌入的资源并且还成功地写入code,以检查字体在用户的系统上已安装。

I've successfully added the font to my solution and set its build action to Embedded Resource and have also successfully written code to check if the font is already installed on the user's system.

现在我只需要弄清楚如何从我的解决方案中提取字体并安装到用户的机器,如果他们安装的字体本身的Office应用程序中使用,等等。

Now I just need to figure out how to extract the font from my solution and install it onto the user's machine as if they installed the font themselves for use in Office applications, etc.

大部分时间我已经找到了例子,是使用VB.NET的应用程序中的字体,而不是外面和一个人的,我发现这似乎适合我的目的不是为我工作。

Most of the examples I've found out there are for using the font within the VB.NET application instead of outside it and the one's I have found which seem to fit my purpose aren't working for me.

推荐答案

字体复制到Windows字体文件夹,然后你需要获取字体添加到注册表。我还没有试过此我自己,但我认为这是可以通过使用 ShellExecuteA API以类似的方式打开字体看的这里

Copy the font into the Windows font folder and then you need to get the font added to the registry. I've not tried this myself, but I think it's possible to do this by opening the font using the ShellExecuteA api in a similar way to as seen here.

下面是做这件事的一个VBScript的方式,可能是因为你也许可以使用类似的语法和功能在VB.Net有用的作为起点:您好,脚本专家!如何安装字体使用脚本?

Here's a vbscript way of doing it that might be useful as a starting point since you might be able to use similar syntax and functions in VB.Net: Hey, Scripting Guy! How Can I Install Fonts Using a Script?

阅读全文

相关推荐

最新文章