Exemplo n.º 1
0
 public void showUSBForm()
 {
     if (f12 != null)
     {
         try
         {
             f12.Visible       = true;
             f12.ShowInTaskbar = true;
             f12.WindowState   = FormWindowState.Normal;
             f12.Show();
             f12.BringToFront();
         }
         catch (Exception e)
         {
         }
     }
     else
     {
         try
         {
             DriveInfo[] drives = mdisk.GetUSBDiskList();
             strList.Clear();
             foreach (DriveInfo drive in drives)
             {
                 if ((drive.DriveType == DriveType.Removable) && !drive.Name.Substring(0, 1).Equals("A"))
                 {
                     try
                     {
                         if (!strList.Contains(drive.Name + "|" + drive.VolumeLabel + "|" + drive.RootDirectory))
                         {
                             strList.Add(drive.Name + "|" + drive.VolumeLabel + "|" + drive.RootDirectory);
                         }
                     }
                     catch (Exception ex)
                     {
                     }
                 }
             }
             if (f12 == null)
             {
                 f12               = new Form12(strList, true);
                 f12.Visible       = true;
                 f12.ShowInTaskbar = true;
                 f12.WindowState   = FormWindowState.Normal;
                 f12.Show();
                 f12.BringToFront();
             }
             else
             {
                 f12.UpdateForm(strList, true);
             }
         }
         catch (Exception ex)
         {
             string ss = ex.Message;
         }
     }
 }