コード例 #1
0
ファイル: Form1.cs プロジェクト: spyrax10/WIFI
        public void Process_stop()
        {
            newprocess.StartInfo.FileName  = "netsh";
            newprocess.StartInfo.Arguments = "wlan stop hostednetwork";
            try
            {
                Process_progressBar.Increment(50);
                using (Process execute = Process.Start(newprocess.StartInfo))
                {
                    execute.WaitForExit();
                    Process_progressBar.Increment(50);
                    button_panel.Visible     = true;
                    Play_Stop_button.Text    = "Start";
                    SSID_textBox.Enabled     = true;
                    Password_textBox.Enabled = true;
                    comboBox1.Enabled        = true;
                    Thread bgthread = new Thread(() => { });

                    bgthread.Abort();
                }
            }
            catch
            {
                //nothing
            }
        }
コード例 #2
0
ファイル: Form1.cs プロジェクト: paladinzh/Virtual-Wifi
 public void Process_start_3()
 {
     newprocess.StartInfo.FileName  = "netsh";
     newprocess.StartInfo.Arguments = "wlan start hostednetwork";
     try
     {
         using (Process execute = Process.Start(newprocess.StartInfo))
         {
             execute.WaitForExit();
             int selectedIndex = comboBox1.SelectedIndex;
             var conn          = virtualRouterHost.GetSharableConnections();
             List <SharableConnection> listOfSharableConnections = conn.ToList();
             virtualRouterHost.Start(listOfSharableConnections[selectedIndex]);
             Process_progressBar.Increment(25);
             button_panel.Visible     = true;
             Play_Stop_button.Text    = "Stop";
             SSID_textBox.Enabled     = false;
             Password_textBox.Enabled = false;
             comboBox1.Enabled        = false;
             bgthread = new Thread(() => ConnectedPeersTracker());
             bgthread.Start();
         }
     }
     catch
     {
         //nothing
     }
 }
コード例 #3
0
ファイル: Form1.cs プロジェクト: paladinzh/Virtual-Wifi
 public void Process_start_2()
 {
     newprocess.StartInfo.FileName  = "netsh";
     newprocess.StartInfo.Arguments = "wlan set hostednetwork mode=allow ssid=" + SSID_textBox.Text + " key=" + Password_textBox.Text;
     try
     {
         using (Process execute = Process.Start(newprocess.StartInfo))
         {
             execute.WaitForExit();
             Process_progressBar.Increment(25);
             Process_start_3();
         }
     }
     catch
     {
         //nothing
     }
 }
コード例 #4
0
ファイル: Form1.cs プロジェクト: paladinzh/Virtual-Wifi
 public void Process_start_1()
 {
     Process_progressBar.Increment(25);
     newprocess.StartInfo.FileName  = "netsh";
     newprocess.StartInfo.Arguments = "wlan stop hostednetwork";
     try
     {
         using (Process execute = Process.Start(newprocess.StartInfo))
         {
             execute.WaitForExit();
             Process_progressBar.Increment(25);
             Process_start_2();
         }
     }
     catch
     {
         //nothing
     }
 }
コード例 #5
0
ファイル: Form1.cs プロジェクト: spyrax10/WIFI
 public void Process_start_2()
 {
     newprocess.StartInfo.FileName  = "netsh";
     newprocess.StartInfo.Arguments = " wlan set hostednetwork mode=allow ssid=" + SSID_textBox.Text + " key=" + Password_textBox.Text;
     try
     {
         // if (InvokeRequired)
         //{
         using (Process execute = Process.Start(newprocess.StartInfo))
         {
             execute.WaitForExit();
             Process_progressBar.Increment(25);
             Process_start_3();
         }
         //}
     }
     catch (Exception e)
     {
         MessageBox.Show(e.Message + " 2");
     }
 }
コード例 #6
0
ファイル: Form1.cs プロジェクト: spyrax10/WIFI
 public void Process_start_1()
 {
     Process_progressBar.Increment(25);
     newprocess.StartInfo.FileName  = "netsh";
     newprocess.StartInfo.Arguments = " wlan stop hostednetwork";
     try
     {
         //if (InvokeRequired)
         //{
         using (Process execute = Process.Start(newprocess.StartInfo))
         {
             execute.WaitForExit();
             Process_progressBar.Increment(25);
             Process_start_2();
         }
         //}
     }
     catch (Exception e)
     {
         MessageBox.Show(e.Message + " 1");
     }
 }