Question

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!

Était-ce utile?

La solution

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

Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top