You can use WMI
Here is an example:
/* CODE BEGIN */
using System;
using System.Management;
public class network
{
public static void Main()
{
SelectQuery query = new SelectQuery( "select name, FreeSpace from
win32_logicaldisk where drivetype=3" );
ManagementObjectSearcher searcher = new ManagementObjectSearcher(query);
foreach( ManagementObject mo in searcher.Get() )
{
Console.WriteLine( "Drive letter is: {0}", mo["name"] );
Console.WriteLine( "Drive's free space is: {0}", mo["FreeSpace"] );
}
// Here to stop app from closing
Console.WriteLine( "\n\nPress Return to exit." );
Console.Read();
}
}
/* CODE END */
I have an example app here for network drives.
http://www.publicjoe.f9.co.uk/csharp/snip/snip010.html
The page has links to relevant MSDN pages as well.
Hope this helps
Publicjoe
C# Tutorial at
http://www.publicjoe.f9.co.uk/csharp/tut.html
C# Snippets at
http://www.publicjoe.f9.co.uk/csharp/snip/snippets.html
C# Ebook at
http://www.publicjoe.f9.co.uk/csharp/samples/ebook.html
VB Ebook at
http://www.publicjoe.f9.co.uk/vbnet/samples/ebook.html
"Jason Chan" <no@mail.com> wrote in message
news:eg*************@TK2MSFTNGP10.phx.gbl...
how can i know how many drive in computer?
Thanks in advance