Domanda

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!

È stato utile?

Soluzione

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

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top