Geeks With Blogs

News



Add to Google

Tim Hibbard CEO for EnGraph software

Windows has pretty good VPN management.  It's pretty good at redialing the connection when the connection is dropped, and for the most part it works.

However, sometimes it thinks it connected to the VPN when it's really not, and it doesn't validate the connection to a specific internal IP.  We needed something that was a bit more robust and could disconnect and reconnect if it couldn't see a specific IP.

This class I wrote takes a VPN connection name and an IP to ping and will use rasphone.exe to connect and NetworkInformation.Ping to verify connectivity.  Every 15 seconds, it checks connectivity and redials as needed.

Obviously, the VPN has to have the authentication saved, and redial attempts set to zero.

My article with the code is here.

Update - Changes made

 

Technorati tags: , , ,
Posted on Monday, January 22, 2007 9:17 AM EnGraph , .NET , VPN | Back to top


Comments on this post: C# .NET code to maintain VPN connection

# re: C# .NET code to maintain VPN connection
Requesting Gravatar...
Which namespace/reference has to be included/set, so that the System.Windows class can be recognized?
Left by datafreak on May 10, 2007 7:45 AM

# re: C# .NET code to maintain VPN connection
Requesting Gravatar...
i have .Net app which is reading data from one of the folder of server. now but when i connect to VPN then only i am able to do that.... with out that how can maintain that VPN code in .Net.
Left by shrilata on May 25, 2010 11:58 PM

# re: C# .NET code to maintain VPN connection
Requesting Gravatar...
creater vpn c#
Left by dung on Oct 15, 2012 6:03 AM

Your comment:
 (will show your gravatar)


Copyright © Tim Hibbard | Powered by: GeeksWithBlogs.net