how do i do that? do i have to use api for it?:rolleyes:
Printable View
how do i do that? do i have to use api for it?:rolleyes:
I believe you can use the System.Management.ManageMentClass to retrieve that information.
I remember seeing an excerpt on MSDN where it retrieved all drives using 3 lines of code, something akin to below:
Code:using System;
using System.Management;
// Disktypes - NoRoot = 1; Removable = 2; LocalDisk = 3; Network = 4; CD = 5; RAMDrive = 6;
public class Wmis {
public static void Main() {
ManagementClass disks = new ManagementClass("Win32_LogicalDisk");
ManagementObjectCollection moc = disks.GetInstances();
foreach(ManagementObject mo in moc)
{
Console.WriteLine("Disk type\t{0}", mo["DriveType"].ToString());
mo.Dispose();
}
disks.Dispose();
}
}
ty all try it when i get home
VB Code:
Dim strDrives As String() = Environment.GetLogicalDrives() Dim drive As String For Each drive In strDrives Console.WriteLine(drive) Next
dynamic_sysop, you're like an encyclopedia of useful stuff. Thanks for contributing so generously in the forums.:)
And you too Nemaroller;)
Oh, if you ever want to see some funny stuff, just do a search by username, and click to the last page of the search result.
no kidding. He has the best answers!! Where do you get your info from? I look at the msdn and can't decrypt it for crap!!Quote:
Originally posted by GSIV
dynamic_sysop, you're like an encyclopedia of useful stuff. Thanks for contributing so generously in the forums.:)
:)