Change icon of generated exe

我的未来我决定 提交于 2019-12-11 09:45:07

问题


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

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


回答1:


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"

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




回答2:


Go into the project properties and select the icon from there. Simple as that.




回答3:


You can use RessourcesHacker AFTER the generation. Not the easiest way, but it works great



来源:https://stackoverflow.com/questions/2164790/change-icon-of-generated-exe

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!