Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
F

fhsBlue

@fhsBlue
About
Posts
1
Topics
0
Shares
0
Groups
0
Followers
0
Following
0

Posts

Recent Best Controversial

  • Retrieve the Name of a Disk Drive
    F fhsBlue

    > Hey! i just checked out ur email so I am answering. The other way: > //Get Drive list...getDrives() implementaion last lines... ManagementObjectCollection queryCollection = getDrives(); //Loop Here...Iterate through each Node.... foreach ( ManagementObject mo in queryCollection) { switch (int.Parse( mo["DriveType"].ToString())) { case 2: //removable drives = 2 (A:\)etc... numberofRemovable++; break; case 3: //Local drives (C:\;D:\;E:\) numberofLocalDisk++; break; case 5: //CD rom drives(F:\;G:\) numberofCD++; break; case 4: //Network drives numberofNetworkdrv++; break; default: //default to folder break; } //objects = ArrayList Object here.. objects.Add(mo["Name"].ToString); }//loop end ///////////////////////////////////////////////////////// /// /// Gets the lists of the logical disks and their infos.. ///////////////////////////////////////////////////////// protected ManagementObjectCollection getDrives() { //get drive collection ManagementObjectSearcher query = new ManagementObjectSearcher("SELECT * From Win32_LogicalDisk "); ManagementObjectCollection queryCollection = query.Get(); return queryCollection; } /////////////////////////////////////////////////////////// I hope this will work for ur application too... regards, fahad... I wish not to seem but to be the Best.... F a h a d H. Siddiqui

    C# csharp com hardware json help
  • Login

  • Don't have an account? Register

  • Login or register to search.
  • First post
    Last post
0
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups