/// <summary> /// 获取本地计算机所有驱动器信息 /// </summary> public void myDriveInfo() { //获取驱动器信息对象 DriveInfo[] myDrive = DriveInfo.GetDrives(); labResult.Text = "所有驱动器信息如下:\n"; //遍历获取每一个驱动器相关信息 foreach ( DriveInfo dir in myDrive ) { labResult.Text += dir.Name + "--" + dir.DriveFormat + "--" + dir.DriveType + "--" + dir.VolumeLabel + "\n"; } }
by: 发表于:2018-01-15 09:56:30 顶(0) | 踩(0) 回复
??
回复评论