how can i calculate the total disc space available + free space + used space in the DVD/CD inserted in f-drive.. and display the result on the label...
views:
22answers:
2
A:
Use GetDriveInfo from the FileSystem class. You need to reference the Microsoft.VisualBasic DLL.
Timores
2010-03-09 09:02:11
Or just use DriveInfo.GetDrives(), that way you don't have to reference the VB library.
Mattias S
2010-03-10 13:45:04
A:
using System.IO;
DriveInfo fDrive = new DriveInfo(@"F:\");
Console.WriteLine(fDrive.AvailableFreeSpace);
Console.WriteLine(fDrive.TotalSize);
For other properties, check this link to MSDN
Veer
2010-03-16 06:35:05