A
andrewcw
I have used System.Management in the past to extract and
walk thru drives & check their type. I can also do it
with COM's FileSystemObject. Here I am trying to just use
the Management Object after using the Directory class...
There seems to be a way to load the System Management
Object with string path ( 8 overloads ), but every time I
try a variation it crashes. Any ideas ? Thanks
Scripting.FileSystemObject FSO = new
Scripting.FileSystemObjectClass();
string [] logDrives=Directory.GetLogicalDrives();
for ( int i =0;i< logDrives.GetUpperBound(0)+1;i++)
{
System.Management.ManagementObject moDrive = new
System.Management.ManagementObject(logDrives); // crash
moDrive.Properties["DriveType"].Value.ToString();
Scripting.Drive thisdrive=FSO.GetDrive(logDrives);
if (thisdrive.DriveType==Scripting.DriveTypeConst.CDRom)
walk thru drives & check their type. I can also do it
with COM's FileSystemObject. Here I am trying to just use
the Management Object after using the Directory class...
There seems to be a way to load the System Management
Object with string path ( 8 overloads ), but every time I
try a variation it crashes. Any ideas ? Thanks
Scripting.FileSystemObject FSO = new
Scripting.FileSystemObjectClass();
string [] logDrives=Directory.GetLogicalDrives();
for ( int i =0;i< logDrives.GetUpperBound(0)+1;i++)
{
System.Management.ManagementObject moDrive = new
System.Management.ManagementObject(logDrives); // crash
moDrive.Properties["DriveType"].Value.ToString();
Scripting.Drive thisdrive=FSO.GetDrive(logDrives);
if (thisdrive.DriveType==Scripting.DriveTypeConst.CDRom)