By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
435,346 Members | 2,158 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 435,346 IT Pros & Developers. It's quick & easy.

small windows code snippet to enable Wireless LAN and disable Wireless LAN

100+
P: 365
I am looking on Internet , I couldn't find, small windows code snippet to enable Wireless LAN and disable Wireless LAN or small dialog to enable / disable wireless LAN.thanks.
Feb 24 '16 #1
Share this Question
Share on Google+
2 Replies


P: 1
I am looking on Internet , I couldn't find,
Feb 24 '16 #2

100+
P: 365
Thanks a lot. wrote simple app - I need to run this app as "Run as administrator" mode, when I am regular user and no admin password with me, I canot run this.

Expand|Select|Wrap|Line Numbers
  1.  
  2. using System;
  3. using System.Collections.Generic;
  4. using System.ComponentModel;
  5. using System.Data;
  6. using System.Drawing;
  7. using System.Linq;
  8. using System.Text;
  9. using System.Threading.Tasks;
  10. using System.Windows.Forms;
  11.  
  12. namespace WindowsFormsApplication2
  13. {
  14.     public partial class Form1 : Form
  15.     {
  16.         public Form1()
  17.         {
  18.             InitializeComponent();
  19.         }
  20.  
  21.         private void button1_Click(object sender, EventArgs e)
  22.         {
  23.             System.Diagnostics.Process process = new System.Diagnostics.Process();
  24.  
  25.             MessageBox.Show("WLAN Enable");
  26.             process.StartInfo.FileName = "net.exe";
  27.             process.StartInfo.Arguments = "start Wlansvc";
  28.             process.Start();
  29.  
  30.         }
  31.  
  32.  
  33.         private void button2_Click_1(object sender, EventArgs e)
  34.         {
  35.             System.Diagnostics.Process process = new System.Diagnostics.Process();
  36.             MessageBox.Show("WLAN Disable");
  37.             process.StartInfo.FileName = "net.exe";
  38.             process.StartInfo.Arguments = "stop Wlansvc";
  39.             process.Start();
  40.         }
  41.  
  42.     }
  43. }
  44.  
  45.  
Feb 24 '16 #3

Post your reply

Sign in to post your reply or Sign up for a free account.