21

I have a URL, a username, and a password. I want to establish a VPN connection in C# .Net WinForms.

Can you please tell me from where I can get started? Any third party API's ?

Code samples will be highly appreciated...

ʇolɐǝz ǝɥʇ qoq
  • 717
  • 1
  • 15
  • 30
xtremist
  • 909
  • 2
  • 9
  • 18

2 Answers2

16

You can launch external application like in this sample. This probably is easiest way to do it, but it depends on external applications.

Or you can try to use Windows API with some wrapper like DotRas. This could be a bit harder, but you won't have any dependancies on particular external apps.

PiRX
  • 3,515
  • 1
  • 19
  • 18
10

You can use the rasdial executable to accomplish this:

System.Diagnostics.Process.Start("rasdial.exe", "VPNConnectionName VPNUsername VPNPassword");

Rasdial is Windows 7.. from memory its RasPhone for XP.

chemicalNova
  • 831
  • 5
  • 12