生成的exe的更改图标 [英] Change icon of generated exe

查看:155
本文介绍了生成的exe的更改图标的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我用codeDomProvider生成的可执行文件与VB.NET。

I'm generating an executable file with VB.NET using CodeDomProvider.

有没有办法更改图标前的编译器创建的exe文件?

Is there a way to change the icon before the compiler creates the exe file?

推荐答案

您可以设置生成的exe由的 CompilerParameters 的那 你传递给code供应商,使用<一个href="http://msdn.microsoft.com/en-us/library/system.$c$cdom.compiler.compilerparameters.compileroptions.aspx"相对=nofollow> CompilerOptions 属性。

You can set the icon of the generated exe by specifying it in the CompilerParameters that you pass to the code provider, using the CompilerOptions property.

Dim parameters As New CompilerParameters()
parameters.CompilerOptions = "/win32icon:C:\full\path\to\icon.ico"

您再通过这些参数的<一个href="http://msdn.microsoft.com/en-us/library/system.$c$cdom.compiler.$c$cdomprovider.compileassemblyfromsource.aspx"相对=nofollow> CompileAssemblyFromSource 方法。然后,生成的exe将使用指定的图标,它的应用程序图标。

You then pass these parameters to the CompileAssemblyFromSource method. The generated exe will then use the specified icon as its application icon.

这篇关于生成的exe的更改图标的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆