Reconnect to VPN - C#

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();