这段代码是对wmi的应用,用c#写的,想转换成c++.net
managementobjectsearcher query = new manageobjectsearcher("select*from win32_logicaldisk");
managementobjectcollection querycollection = query.get();
foreach (managementobject mo in querycollection )
{
switch (int.Parse(mo["DriveType"].ToString()))
case:
……
}
managementobjectsearcher query = new manageobjectsearcher("select*from win32_logicaldisk");
managementobjectcollection querycollection = query.get();
foreach (managementobject mo in querycollection )
{
switch (int.Parse(mo["DriveType"].ToString()))
case:
……
}
managementobjectsearcher^ query = gcnew manageobjectsearcher(L"select*from win32_logicaldisk");
managementobjectcollection^ querycollection = query->get();
for each (managementobject^ mo in querycollection )
{
switch (Int32::Parse(mo[L"DriveType"]))
{
case 0:
……
}
}