|
-
Dec 19th, 2007, 12:19 PM
#1
Thread Starter
Frenzied Member
[RESOLVED] [2.0] Get current harddisk drive letter?
How do you get the current harddisk drive? Like mine is C: but some people use D:, F:, etc.
-
Dec 19th, 2007, 01:21 PM
#2
Re: [2.0] Get current harddisk drive letter?
Are you looking for SystemRoot.
C# Code:
//Returns path of System32 folder in Windows folder
//%SYSTEMROOT%\Windows\System32
string str = System.Environment.SystemDirectory;
//Pass this path to get the drive name
System.IO.DriveInfo di = new System.IO.DriveInfo(str);
Console.WriteLine(di.Name);
-
Dec 19th, 2007, 01:25 PM
#3
Thread Starter
Frenzied Member
Re: [2.0] Get current harddisk drive letter?
 Originally Posted by Harsh Gupta
Are you looking for SystemRoot.
C# Code:
//Returns path of System32 folder in Windows folder
//%SYSTEMROOT%\Windows\System32
string str = System.Environment.SystemDirectory;
//Pass this path to get the drive name
System.IO.DriveInfo di = new System.IO.DriveInfo(str);
Console.WriteLine(di.Name);
thankyou, rated.
-
Dec 20th, 2007, 08:43 AM
#4
Re: [RESOLVED] [2.0] Get current harddisk drive letter?
Glad to help you!!!
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|