title: How do get only available ssid with visual basic 2010
body: <p>Sorry for bad english</p>
  
  <p>I want the available ssid list in listbox</p>
  
  <p>I am use api and its work but It stopped working after a while.And not see current wifi list.</p>
  
  <p>My code:</p>
  
  <pre><code>Imports deneme2.NativeWifi
  Imports System.Text
  
  Public Class Form1
  
      Private Sub Form1_Load(sender As System.Object, e As System.EventArgs) Handles MyBase.Load
          Timer1.Start()
      End Sub
  
      Private Sub scan()
          On Error Resume Next
          Dim client As New WlanClient
          ListView1.Items.Clear()
          For Each wlanIface As WlanClient.WlanInterface In client.Interfaces
              Dim networks() As Wlan.WlanAvailableNetwork = wlanIface.GetAvailableNetworkList(0)
              For Each network As Wlan.WlanAvailableNetwork In networks
                  Dim ssid As Wlan.Dot11Ssid = network.dot11Ssid
                  Dim networkName As String = Encoding.ASCII.GetString(ssid.SSID, 0, CType(ssid.SSIDLength, Integer))
                  Dim item As ListViewItem = New ListViewItem(networkName)
                  item.SubItems.Add(network.dot11DefaultCipherAlgorithm.ToString())
                  item.SubItems.Add(network.wlanSignalQuality.ToString + "%")
                  ListView1.Items.Add(item)
              Next
          Next
      End Sub
  
      Private Sub Timer1_Tick(sender As System.Object, e As System.EventArgs) Handles Timer1.Tick
          scan()
      End Sub
  End Class
  </code></pre>