Possible Duplicate:
Programmatically changing Control Panel network options to connect to VPN
I offer a VPN service to my users, and a lot of them complain that it's a hassle to set up a new VPN connection and switch to it every time they want to connect to my VPN.
After doing some research I found there are ways to do this programatically, for example:
http://hidemyass.com/vpn/
This service offers a program to connect to their VPN service with a username or password. I can do most of this stuff myself, but what I really need help with is how they would connect to the VPN with the program, and how they do it programatically.
What I'd ideally need to do is in the list below:
If anyone knows how this is done and could possibly steer me in the right direction, I'd be very grateful. Also I'd prefer to do this in C# but other languages references would be helpful as well. Thanks.
If the VPN connection exists already, you can call rasdial.exe with various parameters...
System.Diagnostics.Process.Start("rasdial.exe", "My_VPN My_Username My_Password");
I've had a good look around and can't see a way to actually create the VPN programatically - not saying it isn't possible, but it doesn't look trivial. I'd create the VPN by hand and then connect and disconnect by calling rasdial.
You can use the same Proces.Start method to call rasphone, which could be used to take a user through setting up a VPN... (rasphone -a)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With