views:

306

answers:

2

Hi!

I need to be able to connect and reconnect to a VPN connection in Windows 2008 server programmatically. I also need to monitor the state of the connection.

One solution is to use the rsdial application built into windows and use Process.Start() to invoke it. My problem is then how i would monitor the state of the connection.

I am aware of the DotRas project on Codeplex, but i've tried it with no success.

Have you guys got any tips for me?

Edit: Pinging a defined host is not an option, as I need very good timing.

Thanks in advance!

A: 

You could do a periodic ping on the vpn'ed network to a host that is only on that that network.

Preet Sangha
Absolutely, but it would be nice to have events like OnConnectionEstablished etc.
alexn
A: 

Look at the NetworkInterface class. That has exactly the events you are looking for.

Neil Barnwell