你能找到我的问题吗?我无法使用正确的参数打开 rasphone.exe。
private void Button_Click_1(object sender, RoutedEventArgs e)
{
System.Diagnostics.ProcessStartInfo proc = new System.Diagnostics.ProcessStartInfo();
proc.FileName = @"C:\windows\system32\cmd.exe";
proc.Arguments = @"C:\Windows\System32\rasphone.exe -d ""My VPN""";
System.Diagnostics.Process.Start(proc);
}
我也试过:
Process.Start(@"C:\Windows\System32\rasphone.exe", @" -d ""My VPN"" ");
或者:
System.Diagnostics.Process.Start(@"C:\\Users\\***\\Documents\\VPN Launcher\\VPN Launcher\\VPN Launcher\\startVPN.bat");
在 .bat 文件中:
start "" "C:\Windows\System32\rasphone.exe" -d "My VPN"
它打开 cmd/.bat 但我没有使用正确的参数打开 rasphone.exe。