どうしてこれなの
ProcessStartInfo myProcess = new ProcessStartInfo(path);
myProcess.UserName = username;
myProcess.Password = MakeSecureString(password);
myProcess.UseShellExecute = false;
Process.Start(myProcess);
動作しますが
ProcessStartInfo myProcess = new ProcessStartInfo();
myProcess.FileName = Path.GetFileName(path);
myProcess.WorkingDirectory = Path.GetDirectoryName(path);
myProcess.UserName = username;
myProcess.Password = MakeSecureString(password);
myProcess.UseShellExecute = false;
Process.Start(myProcess);
ではありません。
この質問のために2番目のものを使用したかった:https ://stackoverflow.com/a/2621943/1306186
ファイルが見つからないという例外が常に発生しています...何かアイデアはありますか?
編集:
パスはたとえば@"C:\Users\User\Desktop\ConsoleApplication2.exe"