C# 程序调用外部exe,并操作
本来手动的话,是把一个**.fls文件拖到一个**.exe(exe未打开状态拖)中。现在我程序主体(COM口的通信)写好了,但是接下来调用**.exe,**.fls,不知道改怎么弄,而不用再手动呢?
[解决办法]
System.Diagnostics.Process p = new System.Diagnostics.Process();System.Diagnostics.ProcessStartInfo psi = new System.Diagnostics.ProcessStartInfo();psi.FileName = "notepad.exe";//程序psi.Arguments = "1.txt";//参数p.StartInfo = psi;p.Start();
[解决办法]
Process proc = new Process();proc.StartInfo.FileName = "exe全路径";proc.StartInfo.Arguments = "fls全路径";proc.Start();