Beispiel #1
0
 static void Main(string[] args)
 {
     wlanEnabler enabler = new wlanEnabler();
     VirtualRouterHost.IVirtualRouterHost host;
     host = new VirtualRouterHost.VirtualRouterHost();
     host.SetPassword("egordasha");
     host.SetConnectionSettings("User-AP", 10);
     IEnumerable<SharableConnection> list = host.GetSharableConnections();
     SharableConnection ics = (from c in list
                               where c.Name.Contains("vpnclient")
                               select c).First();
     if (host.Start(ics) && host.SetIP("2.0.4.1"))
         Console.ReadLine();
 }
Beispiel #2
0
        private void Form1_Load(object sender, EventArgs e)
        {
            virtualRouterHost  = new VirtualRouterHost.VirtualRouterHost();
            connectedPeersList = new List <ConnectedPeer>();


            foreach (var conn in virtualRouterHost.GetSharableConnections())
            {
                comboBox1.Items.Add(conn.Name);
            }

            if (!IsUserAdminstrator())
            {
                MessageBox.Show("Run as Administrator", "Administrator Privilages Required", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);
                System.Environment.Exit(0);
            }
        }
Beispiel #3
0
        static void Main(string[] args)
        {
            wlanEnabler enabler = new wlanEnabler();

            VirtualRouterHost.IVirtualRouterHost host;
            host = new VirtualRouterHost.VirtualRouterHost();
            host.SetPassword("egordasha");
            host.SetConnectionSettings("User-AP", 10);
            IEnumerable <SharableConnection> list = host.GetSharableConnections();
            SharableConnection ics = (from c in list
                                      where c.Name.Contains("vpnclient")
                                      select c).First();

            if (host.Start(ics) && host.SetIP("2.0.4.1"))
            {
                Console.ReadLine();
            }
        }
Beispiel #4
0
        private void Play_Stop_button_Click(object sender, EventArgs e)
        {
            virtualRouterHost  = new VirtualRouterHost.VirtualRouterHost();
            connectedPeersList = new List <ConnectedPeer>();

            if (!IsUserAdminstrator())
            {
                MessageBox.Show("Run as Administrator", "Administrator Privilages Required", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);
                System.Environment.Exit(0);
            }

            if (Play_Stop_button.Text == "Start")
            {
                button_panel.Visible = false;
                label3.Visible       = true;
                Process_start_1();
            }
            else
            {
                button_panel.Visible = false;
                Process_stop();
            }
        }
        protected override void OnStart(string[] args)
        {
            try
            {
                if (this.serviceHost != null)
                {
                    this.serviceHost.Close();
                }

                this.virtualRouterHost = new VirtualRouterHost.VirtualRouterHost();
                this.serviceHost       = new ServiceHost(this.virtualRouterHost);

                LoadSavedState();

                if (this.serviceHost.State != CommunicationState.Opened)
                {
                    this.serviceHost.Open();
                }
            }
            catch (Exception ex)
            {
                WriteLog("Error Starting Service \n" + ex.ToString());
            }
        }
        protected override void OnStart(string[] args)
        {
            try
            {
                if (this.serviceHost != null)
                {
                    this.serviceHost.Close();
                }

                this.virtualRouterHost = new VirtualRouterHost.VirtualRouterHost();
                this.serviceHost = new ServiceHost(this.virtualRouterHost);

                LoadSavedState();

                if (this.serviceHost.State != CommunicationState.Opened)
                {
                    this.serviceHost.Open();
                }
            }
            catch (Exception ex)
            {
                WriteLog("Error Starting Service \n" + ex.ToString());
            }
        }
Beispiel #7
0
        private void Form1_Load(object sender, EventArgs e)
        {
            virtualRouterHost = new VirtualRouterHost.VirtualRouterHost();
            connectedPeersList = new List<ConnectedPeer>();
            

            foreach (var conn in virtualRouterHost.GetSharableConnections())
            {
                comboBox1.Items.Add(conn.Name);
            }

            if (!IsUserAdminstrator())
            {
                MessageBox.Show("Run as Administrator", "Administrator Privilages Required", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);
                System.Environment.Exit(0);
            }
        }