Esempio n. 1
0
File: IO.cs Progetto: sunpander/VSDT
 /// <summary>
 /// ��ȡ�����̷�
 /// </summary>
 /// <returns></returns>
 public static DisksCode GetDisks()
 {
     string[] diskslist = Directory.GetLogicalDrives();
     DisksCode diskcode = new DisksCode();
     diskcode.Disks = new DiskStruct[diskslist.Length];
     for (int i = 0; i < diskslist.Length; i++)
         diskcode.Disks[i] = new DiskStruct(diskslist[i].Substring(0,2));
     return diskcode;
 }
Esempio n. 2
0
        /// <summary>
        /// ��ʾ�����Ĵ���
        /// </summary>
        /// <param name="diskcode">����ָ��</param>
        public void ShowDisks(DisksCode diskcode)
        {
            DiskStruct[] disk = diskcode.Disks;
            if (disk != null && disk.Length != 0)
            {
                ltv_HostExplorer.Items.Clear();
                ListViewItem[] dItems = new ListViewItem[disk.Length];
                ltv_HostExplorer.Tag = "";

                string name;
                for (int i = 0; i < disk.Length; i++)
                {
                    name = ICanSeeYou.Common.IO.DiskToString(disk[i].Name, true);
                    dItems[i] = new ListViewItem(name);
                    //�ļ���ͼ��
                    dItems[i].ImageKey = (string)imageKey["Disk"];
                    dItems[i].Tag = disk[i];
                    UpdateListView(dItems[i]);
                }
            }
        }
Esempio n. 3
0
File: IO.cs Progetto: sunpander/VSDT
 /// <summary>
 /// ��ʾ�����Ĵ���
 /// </summary>
 /// <param name="diskcode">����ָ��</param>
 /// <param name="lView">��ʾ������б���ͼ�ؼ�</param>
 /// <param name="imageHashtable">�ļ�ͼ��ļ�ֵ(��ϣ��)</param>
 /// <param name="serverDisk">�Ƿ�������Ĵ���</param>
 public static void ShowDisks(DisksCode diskcode, ListView lView, Hashtable imageHashtable, bool serverDisk)
 {
     DiskStruct[] disk = diskcode.Disks;
     if (disk != null && disk.Length != 0)
     {
         lView.Items.Clear();
         ListViewItem[] dItems = new ListViewItem[disk.Length];
         string name;
         lView.Tag = "";
         for (int i = 0; i < disk.Length; i++)
         {
             name = IO.DiskToString(disk[i].Name, serverDisk);
             dItems[i] = new ListViewItem(name);
             //�ļ���ͼ��
             dItems[i].ImageKey = (string)imageHashtable["Disk"];
             dItems[i].Tag = disk[i];
             lView.Items.Add(dItems[i]);
         }
     }
 }