C#:接收从打开方式打开的参数
static void Main(string[] args) { Application.Run(new Form1(args)); } public class Form1: Form { public Form1(string[] args) { if (args.Length 0) { open(args[0]); } } }出现新问题从打开方式打开程序无法启动。通过写日志报错未能找到文件“C:\Windows\system32\icon.ico”。this.Icon new Icon(icon.ico);推论1.从打开方式打开程序路径是 C:\Windows\system32\2.this.Icon new Icon(icon.ico); 是外部引用图标没有打包到 exe 内部只复制 exe 到其他电脑上运行就会报此错误无法启动。可以注释这行让程序正常运行。3.C#: 把图标打包进exe-CSDN博客