free disk space, wmi version

November 25, 2008 by admin  
Filed under C Sharp

free disk space, wmi version with C Sharp

using System;
using System.Management;
class DiskSpace
{
public static void Main (string[] argv)
{
ManagementObject disk = new ManagementObject("win32_logicaldisk.deviceid=\"c:\"");
disk.Get();
Console.WriteLine("Logical Disk Size = " + disk["Size"] + " bytes");
Console.WriteLine("Logical Disk FreeSpace = " + disk["FreeSpace"]+ " bytes");
}
}

Related posts:

  1. free disk space This example shows how to display the free disk space,...
  2. Disk drive info Set objWMIService = GetObject(”winmgmts:”) Set objLogicalDisk = objWMIService.Get(”Win32_LogicalDisk.DeviceID=’c:’”) Wscript.Echo  “Total...
  3. Get disk info using VBScript and the FSO Get disk info using VBScript and the FSO Set objFso...
  4. perform a DNS query perform a DNS query on a domain name using C...
  5. find the hostname for a known IP address find the hostname for a known IP address with C...

Related posts brought to you by Yet Another Related Posts Plugin.

Speak Your Mind

Tell us what you're thinking...
and oh, if you want a pic to show with your comment, go get a gravatar!