Is it possible to connect to a VPN via C # code?

0

My work machine accesses the company's VPN, and when I run the Console application on my machine, I need to be connected to it because the IP of the bank (10.0.0.7) is only accessible via VPN.

The problem is, the internet ALWAYS FALLS, and I have to go in a manual way to connect to VPN again, follow the process image:

That is, I need the human interaction, because when the internet drops, consequently the VPN drops, and I need to click connect.

Is it possible to make this connection via code? so I do not need to put my hand on it anymore.

    
asked by anonymous 10.08.2018 / 20:59

1 answer

0

You can try to connect using an external process

System.Diagnostics.Process.Start("rasdial.exe", "a_minha_ligacao utilizador palavra-passe");
    
10.08.2018 / 22:46