Get Total and Free Disk Space

Category:
C#, VB.NET, ASP.NET
Type:
Snippets
Difficulty:
Intermediate
Author:
Intelligent Solutions Inc.

Version Compatibility: Visual Basic.NET

More information:
Uses PInvoke (Platform Invocation) to call the the GetDiskFreeSpaceEx API function to get free and total space, in megabytes, on the given drive.

Instructions: Copy the declarations and code below and paste directly into your VB project.

Declarations:

Code: