hello, what i'm needing to figure out is how to determine the actual drive number like 0, 1, 2 etc etc if i know the drive letter like c, d, or e. is this possible? i have code to get the drive serial knowing the drive number but first i need to have my application figure out which drive number it's installed on!!
thanks!
drive number from drive lettergetting drive number from known drive letter
Page 1 of 1
7 Replies - 6517 Views - Last Post: 15 September 2007 - 03:13 AM
Replies To: drive number from drive letter
#2
Re: drive number from drive letter
Posted 26 January 2007 - 02:33 PM
linuxbox, on 26 Jan, 2007 - 01:58 PM, said:
hello, what i'm needing to figure out is how to determine the actual drive number like 0, 1, 2 etc etc if i know the drive letter like c, d, or e. is this possible? i have code to get the drive serial knowing the drive number but first i need to have my application figure out which drive number it's installed on!!
thanks!
thanks!
And my I ask why does your program need to know that? And might you add what basic are you using.
#3
Re: drive number from drive letter
Posted 26 January 2007 - 02:46 PM
In VB.net you can use:
Hope it helped
Dim i As Integer = 1
Dim ImOnDrive As String = "C:\"
For Each x As System.IO.DriveInfo In My.Computer.FileSystem.Drives
If ImOnDrive = x.ToString Then MsgBox("I'm on drive: " & i) : Exit For Else i += 1
Next x
Hope it helped
#4
Re: drive number from drive letter
Posted 26 January 2007 - 03:00 PM
m2s87, on 26 Jan, 2007 - 02:33 PM, said:
linuxbox, on 26 Jan, 2007 - 01:58 PM, said:
hello, what i'm needing to figure out is how to determine the actual drive number like 0, 1, 2 etc etc if i know the drive letter like c, d, or e. is this possible? i have code to get the drive serial knowing the drive number but first i need to have my application figure out which drive number it's installed on!!
thanks!
thanks!
And my I ask why does your program need to know that? And might you add what basic are you using.
okay, visual basic 6..
the reason is due to the fact i'm letting a local office use a database program for free but i want to limit it to the hard drive it's currently installed on. if i can determine the disk number from the drive letter it's installed on, then i can get the real physical drive serial number, encode it in registry...decode it at runtime and make sure they don't spread it across their network...that's why......
#5
Re: drive number from drive letter
Posted 26 January 2007 - 03:06 PM
m2s87:
have anything like that which would work for
vb6?
have anything like that which would work for
vb6?
#7
Re: drive number from drive letter
Posted 26 January 2007 - 03:38 PM
m2s87, on 26 Jan, 2007 - 03:32 PM, said:
linuxbox, on 26 Jan, 2007 - 03:06 PM, said:
m2s87:
have anything like that which would work for
vb6?
have anything like that which would work for
vb6?
You can use this snippet, it does exactly what you want.
Hope it helped
hehe...ACTUALLY it won't because that's the volumeserial. i'm against that!! : ) too easily modified in windows. my code gets the actual physical serial number of the drive as presented on the label on the outside of the drive! but i have to tell my code the drive number (0, 1, 2 etc etc) so it can retrieve the serial!!!
#8
Re: drive number from drive letter
Posted 15 September 2007 - 03:13 AM
any progress in resolving the drive number ("Drive 0", "Drive 1" or "Datenträger 0", "Datenträger 1") by an driveletter like "C:" "D:"?
i also would neet a solution (VB 6) . thanks
i also would neet a solution (VB 6) . thanks
Page 1 of 1
|
|

New Topic/Question
Reply




MultiQuote




|