1

I can connect to vpn manually just fine each time.

I am trying to use c# to connect to a vpn. I found this on SO,
How can I programmatically connect to a VPN?
Which shows to connect using this:

System.Diagnostics.Process.Start("rasdial.exe", "VPNName Username Password");

But this only seems to sometimes work. It either connects in about half a second and spends the next couple minutes going back and forth between Connecting to __.... and Verifying username and password... until it gives a remote access error 800.

This never happens when trying to connect normally with windows.

Any idea what might cause this issue and how to resolve it?

Community
  • 1
  • 1
Kyle
  • 32,731
  • 39
  • 134
  • 184
  • 1
    This isn't a C# or programming related problem. It's a VPN problem. The process start has been executed since it tries to establish a connection. Closing it. (Maybe ask on superuser) – Sascha Jun 11 '12 at 17:17
  • 1
    @Sascha even though the vpn works fine outside of this c# code you wouldn't consider there is a programming solution to my problem? I connect to it everyday manually and have never received he error 800. – Kyle Jun 11 '12 at 17:20
  • Do you have access to the server logs? I would start there. Pretty muchs sounds like auth or network error. Though it is somehow strange it works by manually connecting. Maybe a different user account? – Sascha Jun 11 '12 at 17:32

0 Answers0