Given each of the inputs below, I'd like to get free space on that location. Something like
long GetFreeSpace(string path)
Inputs:
c: c: c:emp \server \serverCstorage
this works for me...
using System.IO; private long GetTotalFreeSpace(string driveName) { foreach (DriveInfo drive in DriveInfo.GetDrives()) { if (drive.IsReady && drive.Name == driveName) { return drive.TotalFreeSpace; } } return -1; }
good luck!
1.4m articles
1.4m replys
5 comments
57.0k users