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

Asked

Viewed 301 times

0

My 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 bank IP(10.0.0.7) is only accessible via VPN.

The problem is, the Internet is ALWAYS DOWN, and I have to go manual connect the VPN again, follow the image of the process:

inserir a descrição da imagem aqui

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

Is it possible to make this connection via code? so I don’t need to put my hand on it anymore.

1 answer

0

You can try calling using an external process

System.Diagnostics.Process.Start("rasdial.exe", "a_minha_ligacao utilizador palavra-passe");

Browser other questions tagged

You are not signed in. Login or sign up in order to post.