如何在c#中获取gpt分区信息? [英] how to get gpt partition information in c# ?

查看:120
本文介绍了如何在c#中获取gpt分区信息?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何在c#中获取gpt分区信息?喜欢隐藏?属性? type?

how to get gpt partition information in c# ? like hidden ? attributes ? type ?

推荐答案

使用DriveInfo类:



Make use of DriveInfo Class :

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.IO;

namespace ConsoleApplication1
{
    public class Point
    {
        public Double Lat { get; set; }
        public Double Lng { get; set; }
    }
  
    class Program
    {
        static void Main(string[] args)
        {
            DriveInfo[] drives = DriveInfo.GetDrives();
            foreach (DriveInfo drive in drives)
            {             
                Console.WriteLine("Name:{0}",drive.Name);
                if (drive.IsReady)
                {
                    Console.WriteLine("Size:{0}",drive.TotalSize);
                    Console.WriteLine("AvailableFreeSpace:{0}", drive.AvailableFreeSpace);
                    Console.WriteLine("DriveFormat:{0}", drive.DriveFormat);
                    Console.WriteLine("DriveType:{0}", drive.DriveType);
                    Console.WriteLine("TotalFreeSpace:{0}", drive.TotalFreeSpace);
                    Console.WriteLine("VolumeLabel:{0}", drive.VolumeLabel);
                }

                Console.ReadLine();
            }
           
        }

    }
}


这篇关于如何在c#中获取gpt分区信息?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆