I want to connect internet with gprs modem(Dial up connection) via DotRas but how?

Feb 18, 2010 at 6:34 AM

Hello; i try to write thread GPRS modem to connect web. i need RAs technology. my friends suggested your DOTRAS tec.  Belowe codes is yours. (http://dotras.codeplex.com/wikipage?title=Getting%20Started&referringTitle=Documentation) give me error that is: //'PhoneBookPath' cannot be a null reference or empty string.Parameter name: PhoneBookPath

 

I want to connect internet with gprs modem(Dial up connection) via DotRas but how?

using System;
using DotRas;

internal static class Program
{
    private static RasDialer dialer;

    private static void dialer_StateChanged(object sender, StateChangedEventArgs e)
    {
        Console.WriteLine(e.State.ToString());
    }

    public static void Main(string[] args)
    {
        dialer = new RasDialer();
        dialer.StateChanged += new EventHandler<StateChangedEventArgs>(dialer_StateChanged);
        dialer.EntryName = "MyEntry";

        // Depending on your application, you need to decide between using one of these methods:

        // Synchronously dial the connection. This method will throw an exception if the connection attempt fails.
        dialer.Dial();

        // Asynchronously dial the connection. This method raises the StateChanged event.
        dialer.DialAsync();
    }
}
Coordinator
Feb 18, 2010 at 2:38 PM

You just need to set the PhoneBookPath on the RasDialer component. If you installed the SDK you can see some examples in there along with help documentation. I need to pull that old code off the site anyway, it's a pain updating the stuff in 3 spots everytime I do a build.