Groups | Blog | Home
all groups > c# > october 2006 >

c# : Enumerate all storage devices


Michael Nemtsev
10/11/2006 11:52:01 PM
Use SHGetFileInfo WinAPI for this
Sample is there
http://vbaccelerator.com/home/NET/Code/Libraries/Shell_Projects/Getting_File_Icons_Using_The_Shell/article.asp

--
WBR,
Michael Nemtsev :: blog: http://spaces.msn.com/laflour

"At times one remains faithful to a cause only because its opponents do not
cease to be insipid." (c) Friedrich Nietzsche




[quoted text, click to view]
Jon Slaughter
10/11/2006 11:57:17 PM
I'm trying to make a tree list of possible storage devices for a small app
but I have no idea how to get them. I want something very similar to windows
explorer's tree view. Do I have to manually work with each one(hard drives,
USB drives, networks, etc, special locations, etc..) or is there some way to
get all these possibilities enumerated for me?

Thanks,
Jon

Michael Nemtsev
10/12/2006 12:00:00 AM
Hello Jon,

use Environment.GetLogicalDrives and Environment.GetFolderPath methods

JS> I'm trying to make a tree list of possible storage devices for a
JS> small app but I have no idea how to get them. I want something very
JS> similar to windows explorer's tree view. Do I have to manually work
JS> with each one(hard drives, USB drives, networks, etc, special
JS> locations, etc..) or is there some way to get all these
JS> possibilities enumerated for me?
JS>
JS> Thanks,
JS> Jon
---
WBR,
Michael Nemtsev :: blog: http://spaces.live.com/laflour

"At times one remains faithful to a cause only because its opponents do not
cease to be insipid." (c) Friedrich Nietzsch

Jon Slaughter
10/12/2006 12:12:27 AM

[quoted text, click to view]

It seems System.Enviroment.GetFolderPath does this?

Jon Slaughter
10/12/2006 12:38:53 AM

[quoted text, click to view]

Thanks.

Do you also know how I get the icons used? Do I need to extract them
manually or is there some way to use what explorer uses?

Jon

Jon Slaughter
10/12/2006 2:00:03 AM

[quoted text, click to view]

Ok, Thanks again.

Jon

AddThis Social Bookmark Button