Re: Detecting total and free disk/memory space
From: Herfried K. Wagner [MVP] (hirf-spam-me-here_at_gmx.at)
Date: 02/28/05
- Next message: Herfried K. Wagner [MVP]: "Re: How to remove icon from system tray?"
- Previous message: Herfried K. Wagner [MVP]: "Re: Pad Middle of string with zeros"
- In reply to: RobinSword: "Detecting total and free disk/memory space"
- Next in thread: Brian Swanson: "Re: Detecting total and free disk/memory space"
- Messages sorted by: [ date ] [ thread ]
Date: Mon, 28 Feb 2005 13:50:28 +0100
Robin,
"RobinSword" <schwortschik@gmx-dot-de.no-spam.invalid> schrieb:
> I want my VB.NET-program to detect the total and used amount of disk
> space and memory of the system. How can I do that?
> I know there is WMI, but I don't know which SELECT-Statement I have to
> build in order to get these information.
Add a reference to "System.Management.dll".
\\\
Imports System.Management
.
.
.
Dim disk As New ManagementObject("Win32_LogicalDisk.DeviceID=""C:""")
Dim p As PropertyData
For Each p In disk.Properties
Console.WriteLine("{0} = {1}", p.Name, p.Value)
Next p
///
<URL:http://www.planet-source-code.com/vb/scripts/ShowCode.asp?txtCodeId=842&lngWId=10>
-- M S Herfried K. Wagner M V P <URL:http://dotnet.mvps.org/> V B <URL:http://dotnet.mvps.org/dotnet/faqs/>
- Next message: Herfried K. Wagner [MVP]: "Re: How to remove icon from system tray?"
- Previous message: Herfried K. Wagner [MVP]: "Re: Pad Middle of string with zeros"
- In reply to: RobinSword: "Detecting total and free disk/memory space"
- Next in thread: Brian Swanson: "Re: Detecting total and free disk/memory space"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|