C# 获取本地磁盘盘符

System.IO.DriveInfo[] disk = System.IO.DriveInfo.GetDrives();
            foreach (System.IO.DriveInfo di in disk)
            {
                this.listBox1.Items.Add(di.Name);
            }

得到的结果c:\

d:\

f:\

g:\

posted @ 2010-03-17 16:07  清流鱼  阅读(2140)  评论(2编辑  收藏  举报