Jasinski Technical Wiki

Navigation

Home Page
Index
All Pages

Quick Search
»
Advanced Search »

Contributor Links

Create a new Page
Administration
File Management
Login/Logout
Your Profile

Other Wiki Sections

Software

PoweredBy

Reconnect to VPN - C#

RSS
Modified on Tue, Apr 14, 2020, 7:14 AM by Administrator Categorized as Windows (OS, IE, IIS, and MSMQ), ┬ĚNet Framework

Overview

This article provides a means to connect to a VPN connection from C#

References

https://www.tenforums.com/tutorials/90313-connect-vpn-windows-10-a.html#option3

Code

var psi = new ProcessStartInfo
{
    /* TODO: Adjust "My VPN Connection" to the name of your VPN connection */
    Arguments = "\"My VPN Connection\"",
    FileName = @"c:\windows\system32\rasdial.exe",
    WindowStyle = ProcessWindowStyle.Normal,
    UseShellExecute = true
};

Process.Start(psi).WaitForExit();                  

ScrewTurn Wiki version 3.0.1.400. Some of the icons created by FamFamFam. Except where noted, all contents Copyright © 1999-2020, Patrick Jasinski.