|
SelectQuery query=new SelectQuery("select * from Win32_Directory WHERE Drive='F:'");
ManagementObjectSearcher searcher=new ManagementObjectSearcher(query);
foreach(ManagementBaseObject disk in searcher.Get())
{
tn.Text = disk["VolumeName"].ToString()+"("+disk["Name"].ToString()+")";
}
现在用WMI的Win32_Directory 查询F盘下面的所有文件。但是现在不想查询全部的想指定路径
select * from Win32_Directory WHERE Drive='F:' and Path = '\\Documents and Settings\\'这样确什么也查询不出来。。高手指教啊!!! |
|