1. Restart the program itself
System.Windows.Forms.Application.Restart();
2. add shell command with registry
System.Windows.Forms.Application.Restart();
2. add shell command with registry
Windows Registry Editor Version 5.00
[HKEY_CLASSES_ROOT/pngfile/shell/PNGOUT]
[HKEY_CLASSES_ROOT/pngfile/shell/PNGOUT/command]
@="/"C://Utils//pngout.exe/" /"%1/""
本文介绍了两种实用的方法:一是通过调用 System.Windows.Forms.Application.Restart() 来重启应用程序;二是利用 Windows 注册表编辑器 (Version 5.00) 添加 shell 命令,实现对特定文件类型(如 PNG 图片)的自定义操作。
189

被折叠的 条评论
为什么被折叠?



