)
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]); } } }出現(xiàn)新問題從打開方式打開程序無法啟動(dòng)。通過寫日志報(bào)錯(cuò)未能找到文件“C:\Windows\system32\icon.ico”。this.Icon new Icon(icon.ico);推論1.從打開方式打開程序路徑是 C:\Windows\system32\2.this.Icon new Icon(icon.ico); 是外部引用圖標(biāo)沒有打包到 exe 內(nèi)部只復(fù)制 exe 到其他電腦上運(yùn)行就會報(bào)此錯(cuò)誤無法啟動(dòng)??梢宰⑨屵@行讓程序正常運(yùn)行。3.C#: 把圖標(biāo)打包進(jìn)exe-CSDN博客