Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- rasdial connectionname
- public static int OpenConnection(string connectionName, int Timeout) {
- int ExitCode;
- ProcessStartInfo ProcessInfo;
- Process Process;
- ProcessInfo = new ProcessStartInfo("cmd.exe", "/C rasdial " + connectionName);
- ProcessInfo.CreateNoWindow = true;
- ProcessInfo.UseShellExecute = false;
- Process = Process.Start(ProcessInfo);
- Process.WaitForExit(Timeout);
- ExitCode = Process.ExitCode;
- Process.Close();
- return ExitCode;
- }
- rasdial "connection name" /d
Add Comment
Please, Sign In to add comment