Exemplo n.º 1
0
        private void DrviersList()
        {
            try
            {
                WMIDrives wmiDrives = new WMIDrives();
                int       num2      = 0;
                this.lvwVolumes.Items.Clear();
                if (wmiDrives.VolumeLetter != null)
                {
                    int num4 = wmiDrives.VolumeLetter.Count - 1;
                    for (num2 = 0; num2 <= num4; num2++)
                    {
                        if (wmiDrives.VolumeFileSystem != null)
                        {
                            if (wmiDrives.VolumeFileSystem[num2].ToString() == "NTFS")
                            {
                                int imageIndex = ReturnImageIndex(wmiDrives.VolumeType[num2].ToString());
                                this.lvwVolumes.Items.Add(wmiDrives.VolumeLetter[num2].ToString(), imageIndex);
                                if (wmiDrives.VolumeLabel != null)
                                {
                                    this.lvwVolumes.Items[num2].SubItems.Add(wmiDrives.VolumeLabel[num2].ToString());
                                }
                                else
                                {
                                    this.lvwVolumes.Items[num2].SubItems.Add("N/A");
                                }

                                this.lvwVolumes.Items[num2].SubItems.Add("正常");
                            }
                        }
                        else
                        {
                            this.lvwVolumes.Items.Add("");
                            this.lvwVolumes.Items[0].SubItems.Add("None");
                        }
                    }
                }
            }
            catch
            {
            }
        }
Exemplo n.º 2
0
        private void DrviersList()
        {
            try
            {
                WMIDrives wmiDrives = new WMIDrives();
                int num2 = 0;
                this.lvwVolumes.Items.Clear();
                if (wmiDrives.VolumeLetter != null)
                {
                    int num4 = wmiDrives.VolumeLetter.Count - 1;
                    for (num2 = 0; num2 <= num4; num2++)
                    {
                        if (wmiDrives.VolumeFileSystem != null)
                        {
                            if (wmiDrives.VolumeFileSystem[num2].ToString() == "NTFS")
                            {
                                int imageIndex = ReturnImageIndex(wmiDrives.VolumeType[num2].ToString());
                                this.lvwVolumes.Items.Add(wmiDrives.VolumeLetter[num2].ToString(), imageIndex);
                                if (wmiDrives.VolumeLabel != null)
                                {
                                    this.lvwVolumes.Items[num2].SubItems.Add(wmiDrives.VolumeLabel[num2].ToString());
                                }
                                else
                                {
                                    this.lvwVolumes.Items[num2].SubItems.Add("N/A");
                                }

                                this.lvwVolumes.Items[num2].SubItems.Add("正常");
                            }
                        }
                        else
                        {
                            this.lvwVolumes.Items.Add("");
                            this.lvwVolumes.Items[0].SubItems.Add("None");
                        }
                    }
                }
            }
            catch
            {
            }
        }