Get VPN Connection Status

Aug 7, 2009 at 8:44 PM

Good time. First I would like to thank the creators of this project, which greatly simplifies the task to me! Many thanks. If my project will come, be sure to express my gratitude in tangible form. I have a question: How can I get status my VPN connection, which I get from the PhoneBook? For example, I have a VPN connection with the name "MyVpnConnect" in the code I write: 

if(phoneBook.Entry [ "MyVpnConnect"].(What Method return connect status - connected or disconnected?) == true)

{

               phoneBook.Entry [ "MyVpnConnect"].(What MethodDissconnect VPN connection?);

}

Aug 8, 2009 at 12:57 AM

I realized how to do it! Once cleaned up in your code and write it correctly, with comments, I am ready to publish his version!

Coordinator
Aug 8, 2009 at 4:40 PM

The only way to tell if a connection is active, is to call the GetActiveConnections() method on the RasDialer class. Enumerate through the loop of available connections, and check it there.