Possible Duplicate:
Programmatically determining space available from UNC Path
I'm trying to find a function that I can call from C# to retrieve that information. This is what I have tried so far:
String folder = "z:\myfolder"; // It works
folder = "\\mycomputer\myfolder"; // It doesn't work
System.IO.DriveInfo drive = new System.IO.DriveInfo(folder);
System.IO.DriveInfo a = new System.IO.DriveInfo(drive.Name);
long HDPercentageUsed = 100 - (100 * a.AvailableFreeSpace / a.TotalSize);
This works ok, but only if I pass a drive letter. Is there a way of retrieving the free space by passing a whole path?