[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 ;)
Re: [2008] HDDs & Their Letters
Does it have to be through WMI?
If not cant you just use the My.Computer.FileSystem.Drives collection?
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?
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
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.
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
Re: [2008] HDDs & Their Letters
:D Oh, I wish you speak in Czech language :) No, but how can I know, that Drive D: is my Samsung HD242456LA (<- I made it up) and letter J: and K: is my partitioned Seagate? How could program know which letter is assigned to each harddrive? I dont know how to explain it better :D
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
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.
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.
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.
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 ;)
Re: [2008] HDDs & Their Letters
Please, can anyone help? I really need this ... :)