I was wondering if disk usage monitoring is programmatically possible in VB.NET? I will be using this to monitor our system clones, there is one point that the clones in the queue will fail because of lack of disk space so instead of always scrambling to see what we can delete, I will create an app that will monitor disk space usage and set a threshold, once the threshold is reached it will send an automatic email.

Gracias!

有帮助吗?

解决方案

Available disk space can be found with DriveInfo Class:

Console.WriteLine(New DriveInfo("C:").AvailableFreeSpace)

However it may be necessary to use GetDiskFreeSpaceEx (kernel32).
See also Get free disk space

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top