Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C#
  4. PPPoe connection creation in c#

PPPoe connection creation in c#

Scheduled Pinned Locked Moved C#
csharplinqgraphicshelp
1 Posts 1 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • K Offline
    K Offline
    KARFER
    wrote on last edited by
    #1

    Hello Everyone, I want to create PPPoE Connection. I do this code but it doesn't work and i use the library DotRas (); When I run the code the error appear in the line:

    (RasEntry entry = RasEntry.CreateBroadbandEntry("osama",RasDevice.GetDeviceByName("(PPPoE Osama)",RasDeviceType.PPPoE)); )

    and the error is: Value cannot be null.Parameter name: device The is the Code...

    using System;
    using System.Collections.Generic;
    using System.ComponentModel;
    using System.Data;
    using System.Drawing;
    using System.Linq;
    using System.Text;
    using System.Windows.Forms;
    using DotRas;

    namespace WindowsFormsApplication2
    {

    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
        }
    
    
    
        private void button1\_Click(object sender, EventArgs e)
        {
            string path;
            path = RasPhoneBook.GetPhoneBookPath(RasPhoneBookType.User);
    
            using (RasPhoneBook pbk = new RasPhoneBook())
            {
                pbk.Open(path);
                
                RasEntry entry = RasEntry.CreateBroadbandEntry("osama",RasDevice.GetDeviceByName("(PPPoE Osama)",RasDeviceType.PPPoE));
                // Configure any options for your entry here via entry.Options
                pbk.Entries.Add(entry);
            }
    
    
            using (RasDialer dialer = new RasDialer()) 
            {
                dialer.EntryName = "Your Entry";
                dialer.PhoneBookPath = path;
                dialer.Credentials = new System.Net.NetworkCredential("User", "Password");
                dialer.Dial();
            }
        }
    }
    

    }

    If there is another way please tell me how.

    -*-*-*-*-*-*-*-*-* To Be Or Not To Be (KARFER) -*-*-*-*-*-*-*-*-*

    1 Reply Last reply
    0
    Reply
    • Reply as topic
    Log in to reply
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes


    • Login

    • Don't have an account? Register

    • Login or register to search.
    • First post
      Last post
    0
    • Categories
    • Recent
    • Tags
    • Popular
    • World
    • Users
    • Groups