how to get available space on hard disk
friends today i tell you how to get hard drive space using csharp
first we use using system.io namespace
then we use fileinfo class and driveinfo class
coding
....................
using system.io
public static void Main()
{
fileinfo fs=new fileinfo("c:");
driveinfo ds=new driveinfo(fs.fullname);
Console.Write("drive");
Console.WriteLine(ds.name)
if(ds.IsReady)
{
Console.Write("free space");
Console.WriteLine(ds.Avaliablefreespace.Tostring());
}
}
No comments: