發布時間:2020-08-06 10:46 作者:獨孤劍 閱讀:1182
static void Main(string[] args) { foreach (DriveInfo driver in DriveInfo.GetDrives()) { if (driver.DriveType == DriveType.CDRom) { Console.WriteLine("DVD RW 驅動器: {0}", driver.Name); } else if (driver.DriveType == DriveType.Removable) { Console.WriteLine("可移動磁盤: {0}", driver.Name); } else if (driver.DriveType == DriveType.Fixed) { Console.WriteLine("本地磁盤: {0}", driver.Name); } else { Console.WriteLine("未知磁盤: {0}", driver.Name); } } Console.Read(); }
微信打賞, 微信掃一掃
支付寶打賞, 支付寶掃一掃
如果文章對您有幫助,歡迎給作者打賞