|
-
Feb 4th, 2009, 01:23 PM
#1
Thread Starter
Member
[2008] HDDs & Their Letters
Hi! I have a problem. I want to get letters to each harddrive I have recognized in WMI . I give an example:
I have:
1x HDD (400 GB) Samsung (fixed) - 4 partitions (one of them is for Linux, the biggest problem!)
1x HDD (250 GB) Seagate (external) - 1 partition
And in Windows I can see 4 harddrives. So the thing: How can I get exact letters belonging to Samsung, and letter(s) belonging to Seagate? Make sure, that user can have more drives and more partition (maybe Linux too) ... I can divide my Seagate too, like 20 GB and 230 GB ... you know. I've checked much things in WMI like Win32_DiskPartition, but it does not help me so much ... Thanks for any suggestions
-
Feb 4th, 2009, 01:25 PM
#2
Re: [2008] HDDs & Their Letters
Does it have to be through WMI?
If not cant you just use the My.Computer.FileSystem.Drives collection?
-
Feb 4th, 2009, 01:28 PM
#3
Thread Starter
Member
Re: [2008] HDDs & Their Letters
Hm, I ve checked that too, but how can I assign letters to HDD Model and everything? I am programming an informational and benchmark program now.
Like in HDTach: example ...
Samsung HD420JL ( C:,D:,E: ) - 400 GB ... How can I recognize these letters in disk has partitions?
-
Feb 4th, 2009, 01:30 PM
#4
Re: [2008] HDDs & Their Letters
What do you mean you want to actually give the HDs letters? Or do you mean you just want to find out what letters they already have?
I am sure each item in the Drives collection I mentioned has a property called DriveLetter or something...
As for finding out the model etc then yeah you probably will need WMI or something similar for that
-
Feb 4th, 2009, 01:41 PM
#5
Thread Starter
Member
Re: [2008] HDDs & Their Letters
Yes, I have to find out hard disk model in WMI. But, I want to know, what letter (or letters if it has more partitions) Windows use for this HD (HD, that I found in WMI before).
I think it's a bit harder than I thought.
Last edited by iMPR3SSiON; Feb 4th, 2009 at 01:44 PM.
Code Hard, Go Pro!
-
Feb 4th, 2009, 01:53 PM
#6
Re: [2008] HDDs & Their Letters
You can use that Drives collection I mentioned for the drive letters like I said 
vb Code:
For Each Drive As IO.DriveInfo In My.Computer.FileSystem.Drives
MessageBox.Show(Drive.Name)
Next
-
Feb 4th, 2009, 02:09 PM
#7
Thread Starter
Member
-
Feb 4th, 2009, 02:26 PM
#8
Re: [2008] HDDs & Their Letters
Ahhh I see what you mean now! Sorry.
So have you already got the WMI bit working that gets the model number etc? If not, here's an example: http://www.geekpedia.com/tutorial233...nd-Csharp.html
Also, this might help you get the drive letter: http://bytes.com/groups/net-c/272971...em#post1091940
-
Feb 4th, 2009, 02:41 PM
#9
Thread Starter
Member
Re: [2008] HDDs & Their Letters
I am sorry. My English is rubbish, really.
Can I add C# into my VB.NET project? Or convert it somehow?
EDIT: I don't really understand it ... it's kind of messy text here and there. Can you describe, how can I get these letters?
It will help me a lot, I can put your weblink or your nick into my program's About box, if it will be done. Thank you.
Last edited by iMPR3SSiON; Feb 4th, 2009 at 02:47 PM.
Code Hard, Go Pro!
-
Feb 5th, 2009, 08:53 AM
#10
Thread Starter
Member
Re: [2008] HDDs & Their Letters
Hey, guys!
Can somebody explain me this mess here:
http://bytes.com/groups/net-c/272971...letter-problem
It would help me a lot, thanks.
-
Feb 5th, 2009, 09:02 AM
#11
Re: [2008] HDDs & Their Letters
gigemboy has provided a CodeBank submission on this very site that demonstrates getting all sorts of information using WMI.
http://www.vbforums.com/showthread.php?t=387626
No, you can't add C# code to a VB project or vice versa. Each project can contain only one language. Each project can reference other projects though, and those other projects could written in another language.
-
Feb 5th, 2009, 11:46 AM
#12
Thread Starter
Member
Re: [2008] HDDs & Their Letters
Thanks for the link, but actually it is unable to download this DLL file. I have just problem with HDD Letters ... can you help?
You know, if you have this DLL, you can provide another link (mediafire.com ...), it will be handy
-
Feb 20th, 2009, 09:20 AM
#13
Thread Starter
Member
Re: [2008] HDDs & Their Letters
Please, can anyone help? I really need this ...
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
|