获取驱动器信息 [英] getting drives information

查看:61
本文介绍了获取驱动器信息的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

string []驱动器= Directory.GetLogicalDrives();

在这里,我要获得唯一的cdrom/dvd rom驱动器

我如何找出那个

string[] drives = Directory.GetLogicalDrives();

here i want get the only cdrom/dvd rom drives

how can i find out that

推荐答案

这篇文章讨论了同一件事: ^ ]

希望对您有所帮助!
This post discusses about the same thing: http://www.eggheadcafe.com/software/aspnet/30307033/detecting-cd-drive-letter-in-c.aspx[^]

Hope it helps!


我知道这是一个老问题,您早就找到了解决方案,但这可能会对其他正在寻找...的人有所帮助.

I know this is an old question and you''ve long since found your solution, but this may help someone else who''s looking...

foreach (System.IO.DriveInfo drive in System.IO.DriveInfo.GetDrives()) {
	if (drive.DriveType == DriveType.CDRom) {
		// Your code here

	}
}



浏览此链接-
getting-cddvd-drive-capabilities-using -wmi-and-C-Sharp/ [
Hi,
Go through this link-
getting-cddvd-drive-capabilities-using-wmi-and-C-Sharp/[^]


这篇关于获取驱动器信息的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆