How to change RAS Server Address

Jan 15, 2011 at 9:16 PM

Hi,

I would like to know, how can i change the RAS Server Address in VPN (PPTP) created using by DotRAS. Because we have about 5 servers, and each time employees need to dial to different servers to perform different tasks.

Please let me know how can i change the server address using DotRAS.

Coordinator
Jan 15, 2011 at 10:53 PM

Sorry I deleted your 2nd post, but it had your VPN server address in it. Didn't think you wanted that getting leaked and put on every search engine that scans the website.

Yep, just have to set the PhoneNumber property (I know it's strange, that's what Windows called it) and then call the Update method as you did in the example you had posted.

Jan 15, 2011 at 11:14 PM

Dear Jeff,

Thanks for your concern, but that is a local domain that we use in internal network.

I would also like to ask one more thing.

I am working to get Bytes Transferred and Bytes Received by the particular VPN connection by name. If possible can you please guide me how to do this.

Coordinator
Jan 16, 2011 at 5:54 AM

Just need to retrieve the connection you want to check, and get the connection statistics.

RasConnection connection = RasConnection.GetActiveConnectionByName("VPN Connection", "C:\\MyPhoneBook.pbk");
if (connection != null)
{
    RasLinkStatistics stats = connection.GetConnectionStatistics();
    if (stats != null)
    {
        // The stats will contain the bytes transferred and received.
    }
}

That basic example should get you started.

Jan 16, 2011 at 4:39 PM

HI,

Is it necessary to give any particular phonebook, as i dont want to give any phone book, can i just retrieve Connection by Name. I will give it a try tonight and will post the results.

And once again Thanks for your time and help.

Coordinator
Jan 16, 2011 at 7:34 PM

Well you don't have to call that method if you don't want to. You can just call GetActiveConnections and find it however you want. The only reason that the GetActiveConnectionByName method requires the path to the phonebook is because you can have two connections active with the same name but not in the same phonebook.

Jan 16, 2011 at 8:22 PM

Thanks allot dear,

 

Finally got it working as i wanted.

Coordinator
Jan 17, 2011 at 12:09 AM

Glad to hear it, have fun with your project.