Click here to Skip to main content
15,896,111 members
Home / Discussions / C#
   

C#

 
AnswerRe: Finding a screens refresh rate Pin
JoeRip21-Aug-08 2:59
JoeRip21-Aug-08 2:59 
AnswerRe: Finding a screens refresh rate Pin
JoeRip21-Aug-08 3:11
JoeRip21-Aug-08 3:11 
GeneralRe: Finding a screens refresh rate Pin
Anthony Mushrow21-Aug-08 4:38
professionalAnthony Mushrow21-Aug-08 4:38 
QuestionIs there a way? Pin
Silvyster21-Aug-08 2:24
Silvyster21-Aug-08 2:24 
AnswerRe: Is there a way? Pin
SomeGuyThatIsMe21-Aug-08 2:29
SomeGuyThatIsMe21-Aug-08 2:29 
AnswerRe: Is there a way? Pin
Manas Bhardwaj21-Aug-08 2:31
professionalManas Bhardwaj21-Aug-08 2:31 
AnswerRe: Is there a way? Pin
lisan_al_ghaib21-Aug-08 2:34
lisan_al_ghaib21-Aug-08 2:34 
AnswerRe: Is there a way? Pin
Samer Aburabie21-Aug-08 15:13
Samer Aburabie21-Aug-08 15:13 
Of course you can ... alot of ways to do so and WMI is one of them ... use the System.Management namespace to help you so ... as follows:

ArrayList list = new ArrayList();
            using (ManagementObjectSearcher DiskSearch = new ManagementObjectSearcher(new SelectQuery("Select * from Win32_LogicalDisk")))
            {
                using (ManagementObjectCollection moDiskCollection = DiskSearch.Get())
                {
                    foreach (ManagementObject mo in moDiskCollection)
                    {
                        list.Add(mo["Name"].ToString ());
                        MessageBox.Show(mo["Name"].ToString());
                        mo.Dispose();
                    }
                }
            }

Dont forget to add a reference in your project to System.Management dll and you will get all the drives .. for more properties go to this link to get them (other than the Name property used here):

http://msdn.microsoft.com/en-us/library/aa394173.aspx[^]

Enjoy !

Note: If you found this answer useful please indicate that so other would know so.

Sincerely Samer Abu Rabie

Software Engineer

QuestionWizards... again. Pin
V.21-Aug-08 2:20
professionalV.21-Aug-08 2:20 
Questiona really newbie, quick and easy question... Pin
laziale21-Aug-08 2:08
laziale21-Aug-08 2:08 
AnswerRe: a really newbie, quick and easy question... Pin
leppie21-Aug-08 2:11
leppie21-Aug-08 2:11 
GeneralRe: a really newbie, quick and easy question... Pin
laziale21-Aug-08 2:14
laziale21-Aug-08 2:14 
AnswerRe: a really newbie, quick and easy question... Pin
Christian Graus21-Aug-08 2:13
protectorChristian Graus21-Aug-08 2:13 
GeneralRe: a really newbie, quick and easy question... Pin
leppie21-Aug-08 2:16
leppie21-Aug-08 2:16 
GeneralRe: a really newbie, quick and easy question... Pin
lisan_al_ghaib21-Aug-08 2:17
lisan_al_ghaib21-Aug-08 2:17 
GeneralRe: a really newbie, quick and easy question... Pin
Pete O'Hanlon21-Aug-08 2:19
mvePete O'Hanlon21-Aug-08 2:19 
GeneralRe: a really newbie, quick and easy question... Pin
Christian Graus21-Aug-08 2:22
protectorChristian Graus21-Aug-08 2:22 
AnswerRe: a really newbie, quick and easy question... Pin
Pete O'Hanlon21-Aug-08 2:18
mvePete O'Hanlon21-Aug-08 2:18 
GeneralRe: a really newbie, quick and easy question... Pin
leppie21-Aug-08 2:22
leppie21-Aug-08 2:22 
GeneralRe: a really newbie, quick and easy question... Pin
laziale21-Aug-08 2:24
laziale21-Aug-08 2:24 
GeneralRe: a really newbie, quick and easy question... Pin
Pete O'Hanlon21-Aug-08 2:39
mvePete O'Hanlon21-Aug-08 2:39 
GeneralRe: a really newbie, quick and easy question... Pin
leppie21-Aug-08 2:45
leppie21-Aug-08 2:45 
GeneralRe: a really newbie, quick and easy question... Pin
Pete O'Hanlon21-Aug-08 2:48
mvePete O'Hanlon21-Aug-08 2:48 
GeneralRe: a really newbie, quick and easy question... Pin
leppie21-Aug-08 2:54
leppie21-Aug-08 2:54 
GeneralRe: a really newbie, quick and easy question... Pin
Pete O'Hanlon21-Aug-08 3:11
mvePete O'Hanlon21-Aug-08 3:11 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.