Exemplo n.º 1
0
        void LoadProfiles()
        {
            try{
                if (profiles == null)
                {
                    profiles = new Netsh();
                }
                else
                {
                    profiles.LoadProfiles();
                }

                if (profiles.Profiles.Length > 0)
                {
                    listBoxProfiles.Items.AddRange(profiles.Profiles);
                    listBoxProfiles.SetSelected(0, true);
                    noProfiles = false;
                }
            }

            //on errors set noProfiles to true and add apropriate
            //error message as item to the names list
            catch (System.ComponentModel.Win32Exception) {
                noProfiles = true;
                listBoxProfiles.Items.Add(" -- netsh tool not at your system --");
            }
            catch (NoProfilesException) {
                noProfiles = true;
                listBoxProfiles.Items.Add(" -- No WLAN profiles found --");
            }
        }
Exemplo n.º 2
0
 void LoadProfiles()
 {
     try{
         if(profiles == null)
             profiles = new Netsh() ;
         else
             profiles.LoadProfiles() ;
         listBoxProfiles.Items.AddRange(profiles.Profiles) ;
         listBoxProfiles.SetSelected(0, true) ;
         noProfiles = false ;
     }
     //on errors set noProfiles to true and add apropriate
     //error message as item to the names list
     catch(System.ComponentModel.Win32Exception){
         noProfiles = true ;
         listBoxProfiles.Items.Add(" -- netsh tool not at your system --") ;
     }
     catch(NoProfilesException){
         noProfiles = true ;
         listBoxProfiles.Items.Add(" -- No WLAN profiles found --") ;
     }
 }