Unity打开外部文件
1. 打开本文文档
string path = @"C:\Users\Administrator\Desktop\Equipment.xml";
ProcessStartInfo pfi = new ProcessStartInfo("notepad.exe", path);
System.Diagnostics.Process.Start(pfi);
或者
Application.OpenURL("C:/Users/Administrator/Desktop/Equipment.xml");
2. 打开外部程序
Application.OpenURL("C:/Users/Administrator/Desktop/Equipment.xml");
快捷方式所在的路径是没有作用的。
3.使用Unity调用c#winform exe文件
ProcessStartInfo processStartInfo = new ProcessStartInfo();
processStartInfo.FileName = Application.streamingAssetsPath + "/UpdatePackage/FS_AIOTSIMUpdatePackage.exe";
//参数表示:需要通过空格来分割参数
string paremter = string.Format("{0} {1}", "参数1", "参数2");
processStartInfo.Arguments = paremter;
Process.Start(processStartInfo);

浙公网安备 33010602011771号