Click here to Skip to main content
15,916,600 members
Home / Discussions / C#
   

C#

 
GeneralRe: It doesn't work Pin
4-Mar-04 20:05
suss4-Mar-04 20:05 
GeneralRe: It doesn't work Pin
partyganger4-Mar-04 20:52
partyganger4-Mar-04 20:52 
GeneralIt 's working now Pin
hongheo765-Mar-04 6:56
hongheo765-Mar-04 6:56 
Questionhow to move bar like MSMessenger Pin
yu-yu4-Mar-04 17:48
yu-yu4-Mar-04 17:48 
AnswerRe: how to move bar like MSMessenger Pin
John Fisher5-Mar-04 8:48
John Fisher5-Mar-04 8:48 
GeneralRe: how to move bar like MSMessenger Pin
yu-yu5-Mar-04 11:59
yu-yu5-Mar-04 11:59 
Questiongetting disc space ?? Pin
azusakt4-Mar-04 15:13
azusakt4-Mar-04 15:13 
AnswerRe: getting disc space ?? Pin
Roman Rodov4-Mar-04 18:41
Roman Rodov4-Mar-04 18:41 
You can choose to use the native Win32 API functions through P/Invoke. Or you can go the modern and more elegant way of using the Windows Management interface classes of the .NET framework.:
<br />
// include these namespaces:<br />
using System.Management.Instrumentation;<br />
using System.Management;<br />
<br />
// Get the management class holding Logical Drive information<br />
ManagementClass mcDriveClass = new ManagementClass("Win32_LogicalDisk");<br />
// Enumerate all logical drives available<br />
ManagementObjectCollection mocDrives = mcDriveClass.GetInstances();<br />
foreach(ManagementObject moDrive in mocDrives)<br />
{<br />
  // DriveType = 3 (local logical drives) DriveType = 4 (network drives)<br />
 /*<br />
 Other values of DriveType property:<br />
 0 Unknown <br />
 1 No Root Directory <br />
 2 Removable Disk <br />
 3 Local Disk <br />
 4 Network Drive <br />
 5 Compact Disc <br />
 6 RAM Disk <br />
 */<br />
 if (int.Parse(moDrive.Properties["DriveType"].Value.ToString()) == 3 || int.Parse(moDrive.Properties["DriveType"].Value.ToString()) == 4)<br />
{<br />
 // sDeviceId will hold the drive name eg "C:"<br />
 String sDeviceId = moDrive.Properties["DeviceId"].Value.ToString();<br />
 // dSize and dFree will hold the size of the drive and free space in bytes<br />
 long dSize = long.Parse(moDrive.Properties["Size"].Value.ToString());<br />
 long dFree = long.Parse(moDrive.Properties["FreeSpace"].Value.ToString());<br />
}<br />
}<br />
mocDrives.Dispose();<br />
mcDriveClass.Dispose();<br />


For more info on the Win32_LogicalDisk management class see
Win32_LogicalDisk class @ MSDN[^]
GeneralRe: getting disc space ?? Pin
azusakt4-Mar-04 19:32
azusakt4-Mar-04 19:32 
GeneralRe: getting disc space ?? Pin
Roman Rodov4-Mar-04 23:41
Roman Rodov4-Mar-04 23:41 
GeneralDataGrid Checkbox Event capture Pin
Ruchi Gupta4-Mar-04 14:27
Ruchi Gupta4-Mar-04 14:27 
GeneralRe: DataGrid Checkbox Event capture Pin
Heath Stewart5-Mar-04 3:32
protectorHeath Stewart5-Mar-04 3:32 
GeneralRe: DataGrid Checkbox Event capture Pin
Heath Stewart5-Mar-04 5:38
protectorHeath Stewart5-Mar-04 5:38 
GeneralRe: DataGrid Checkbox Event capture Pin
Ruchi Gupta5-Mar-04 6:15
Ruchi Gupta5-Mar-04 6:15 
GeneralWeb based paint tool Pin
AWebDude4-Mar-04 8:43
AWebDude4-Mar-04 8:43 
GeneralRe: Web based paint tool Pin
Mazdak4-Mar-04 8:49
Mazdak4-Mar-04 8:49 
GeneralRe: Web based paint tool Pin
Dave Kreskowiak4-Mar-04 9:05
mveDave Kreskowiak4-Mar-04 9:05 
GeneralRe: Web based paint tool - WinForm Pin
AWebDude4-Mar-04 9:25
AWebDude4-Mar-04 9:25 
GeneralRe: Web based paint tool - WinForm Pin
Mazdak4-Mar-04 9:39
Mazdak4-Mar-04 9:39 
GeneralRe: Web based paint tool - WinForm Pin
Dave Kreskowiak4-Mar-04 10:24
mveDave Kreskowiak4-Mar-04 10:24 
GeneralRe: Web based paint tool - WinForm Pin
OmegaSupreme4-Mar-04 10:24
OmegaSupreme4-Mar-04 10:24 
GeneralRe: Web based paint tool Pin
Heath Stewart4-Mar-04 10:28
protectorHeath Stewart4-Mar-04 10:28 
GeneralRe: Web based paint tool Pin
partyganger4-Mar-04 20:54
partyganger4-Mar-04 20:54 
QuestionHow to deal with lengthy tasks Pin
hongheo764-Mar-04 7:52
hongheo764-Mar-04 7:52 
AnswerRe: How to deal with lengthy tasks Pin
Mazdak4-Mar-04 8:08
Mazdak4-Mar-04 8:08 

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.