EXE - .NET winforms 中的 .Ico 文件更改
我有一个 EXE,其图标为 Image1.ico,我转到解决方案资源管理器的属性 -> 应用程序选项卡 ->选择图标和清单并选择新图像图标 Image2.ico。
在我构建并运行 EXE 后,EXE 会加载旧图像图标 (Image1.ico)。
对此有何意见?
提前致谢, 卡西克
I have an EXE which as Image1.ico as its Icon and i went to properties of the solution explorer->Application tab-> Selected Icon and Manifest and selected new image icon Image2.ico.
After i build and run the EXE, the EXE loads with old image icon (Image1.ico).
Any inputs on this?
Thanks in advance,
Karthick
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
Windows 通常会使用它在文件中找到的第一个图标。因此,如果 Image1.ico 仍在您的资源中,您需要将其删除。
Windows 还有一个图标缓存,它可能会向您显示缓存中的图标,而不是 exe 中的新图标。如果更改 .exe 文件的名称,它会显示旧图标还是新图标?
编辑:
好的,因为问题是图标缓存需要刷新。这是有关如何在 Win7 和 Vista 上执行此操作的说明
http://www.winhelponline .com/blog/how-to-rebuild-the-icon-cache-in-windows-vista/
对于 Windows XP,您可以使用 Tweak UI
http://www.microsoft.com/windowsxp/Downloads/powertoys/Xppowertoys。 mspx
Windows will normally use the first icon it finds in the file. So if Image1.ico is still in your resources, you need to remove it.
Windows also has an icon cache, and it might be showing you the icon from the cache rather than the new one from your exe. If you change the name of the .exe file, does it show the old icon or the new one?
Edit:
Ok since the problem is that the icon cache needs to be flush. Here's instructions on how to do it on Win7 and Vista
http://www.winhelponline.com/blog/how-to-rebuild-the-icon-cache-in-windows-vista/
For Windows XP you can use Tweak UI
http://www.microsoft.com/windowsxp/Downloads/powertoys/Xppowertoys.mspx
首先检查图标和图标使用的分辨率。如果它包含一个 32x32 和一个 16x16 图像,则可能是 Visual Studio 搞砸了。要解决此问题,请保存解决方案并关闭它,删除“bin\debug”和“bin\release”目录中的 EXE。重新打开解决方案并进行全新构建...
希望这有帮助,
此致,
汤姆.
Check first for the icon and the resolution used for the icon. If it contains a 32x32 and a 16x16 image, then it could be that Visual Studio is messing up. To remedy this, saving the solution and close it, delete the EXE's in the 'bin\debug' and 'bin\release' directories. Re-open the solution and do a fresh build...
Hope this helps,
Best regards,
Tom.