查看系统硬盘大小

DriveInfo driveinfo = new DriveInfo(@"C:\");
Console.WriteLine((double)driveinfo.AvailableFreeSpace/(1024*1024*1024)+"G");
Console.WriteLine((double)driveinfo.TotalSize / (1024 * 1024 * 1024)+"G");
posted @ 2012-03-25 07:57  张小然  阅读(201)  评论(0编辑  收藏  举报