更新时间:2022-12-08 20:25:45
尝试:Process.Start( @ C:\ Users \trainee7 \Desktop\ConsoleApplication2 \ConsoleApplication2 \bin\Debug\ConsoleApplication2.exe ,
@ C:\ Users \trainee7 \Desktop\\\
otepads \\ \\ec2.txt跨度>);
When I write"C:\Users\trainee7\Desktop\ConsoleApplication2\ConsoleApplication2\bin\Debug\ConsoleApplication2.exe C:\Users\trainee7\Desktop\notepads\ec2.txt"
in my cmd it will execute."C:\Users\trainee7\Desktop\ConsoleApplication2\ConsoleApplication2\bin\Debug\ConsoleApplication2.exe"
is for open notepad files.
but my
Process.Start(@"C:\Users\trainee7\Desktop\ConsoleApplication2\ConsoleApplication2\bin\Debug\ConsoleApplication2.exe C:\Users\trainee7\Desktop\notepads\ec2.txt");
arise filenotexception
How can solve it?
Try:Process.Start(@"C:\Users\trainee7\Desktop\ConsoleApplication2\ConsoleApplication2\bin\Debug\ConsoleApplication2.exe", @"C:\Users\trainee7\Desktop\notepads\ec2.txt");