daily pastebin goal
88%
SHARE
TWEET

Untitled

a guest Jan 23rd, 2019 54 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. private void Form1_Load(object sender, EventArgs e)
  2.             {
  3.                 wifi = new Wifi();
  4.                 List<AccessPoint> aps = wifi.GetAccessPoints();
  5.  
  6.                 foreach (AccessPoint ap in aps)
  7.                 {
  8.                     ListViewItem lvItem = new ListViewItem(ap.Name);
  9.                     lvItem.SubItems.Add(ap.SignalStrength + "%");
  10.                     lvItem.Tag = ap;
  11.  
  12.                     listNet.Items.Add(lvItem);
  13.  
  14.                 }
  15.             }
  16.  
  17.             private void button1_Click_1(object sender, EventArgs e)
  18.             {
  19.                 if (listNet.SelectedItems.Count > 0 && textBox1.Text.Length > 0)
  20.                 {
  21.                     ListViewItem selectedItem = listNet.SelectedItems[0];
  22.  
  23.                     AccessPoint ap = (AccessPoint)selectedItem.Tag;
  24.  
  25.                     if (connectToWifi(ap, textBox1.Text))
  26.                         label2.Text = "Есть контакт " + ap.Name;
  27.                     else
  28.                         label2.Text = "Пробуй еще";
  29.                 }
  30.                 else
  31.                     label2.Text = "Введи пароль";
  32.             }
  33.    
  34. ListViewItem lvItem = new ListViewItem(ap.Name);
  35.                 lvItem.SubItems.Add(ap.SignalStrength + "%");
  36.    
  37. ListViewItem selectedItem = listNet.SelectedItems[0];
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top