This project is read-only.

How to connect to an existing PBK VPN file

Aug 29, 2014 at 12:05 PM
Edited Aug 29, 2014 at 12:10 PM
Hi, I'm trying to connect to an existing PBK file in a directory,

this is my code:
RasDialer dialer = new RasDialer();
dialer.PhoneBookPath = Application.StartupPath + "\pptp.pbk";
dialer.EntryName = "mersad";
dialer.Credentials = new System.Net.NetworkCredential("test", "test");
and the exception is:
An unhandled exception of type 'DotRas.RasException' occurred in DotRas.dll
Additional information: The system could not find the phone book entry for this connection.
Please guide me if you can, Thanks.
Aug 10, 2016 at 10:20 AM
Edited Aug 10, 2016 at 10:29 AM
check if connection exists in phonebook
if (!RasEntry.Exists("mersad", "pptp.pbk"))