- [DEVEXPRESS] Hỗ trợ tìm kiếm highlight không dấu và không khoảng cách trên Gridview Filter
- [C#] Chia sẻ source code phần mềm Image Downloader tải hàng loạt hình ảnh từ danh sách link url
- [C#] Chụp hình và quay video từ camera trên winform
- [C#] Chia sẽ full source code tách file Pdf thành nhiều file với các tùy chọn
- Giới thiệu về Stock Tracker Widget - Công cụ theo dõi cổ phiếu và cảnh báo giá tăng giảm bằng C# và WPF
- [VB.NET] Chia sẻ công cụ nhập số tiền tự động định dạng tiền tệ Việt Nam
- [VB.NET] Hướng dẫn fill dữ liệu từ winform vào Microsoft word
- [VB.NET] Hướng dẫn chọn nhiều dòng trên Datagridview
- Hướng Dẫn Đăng Nhập Nhiều Tài Khoản Zalo Trên Máy Tính Cực Kỳ Đơn Giản
- [C#] Chia sẻ source code phần mềm đếm số trang tập tin file PDF
- [C#] Cách Sử Dụng DeviceId trong C# Để Tạo Khóa Cho Ứng Dụng
- [SQLSERVER] Loại bỏ Restricted User trên database MSSQL
- [C#] Hướng dẫn tạo mã QRcode Style trên winform
- [C#] Hướng dẫn sử dụng temp mail service api trên winform
- [C#] Hướng dẫn tạo mã thanh toán VietQR Pay không sử dụng API trên winform
- [C#] Hướng Dẫn Tạo Windows Service Đơn Giản Bằng Topshelf
- [C#] Chia sẻ source code đọc dữ liệu từ Google Sheet trên winform
- [C#] Chia sẻ source code tạo mã QR MOMO đa năng Winform
- [C#] Chia sẻ source code phần mềm lên lịch tự động chạy ứng dụng Scheduler Task Winform
- [C#] Hướng dẫn download file từ Minio Server Winform
[C#] Hướng dẫn lấy thông tin dung lượng ổ đĩa Hard Disk trên windows
Xin chào các bạn, bài viết hôm nay mình sẽ hướng dẫn các bạn cách lấy thông tin dung lượng, định dạng thiết bị của ổ cứng Hask Disk trên Windows C#.
[C#] Get Information Hard Disk Winform
Dưới đây là giao diện demo ứng dụng:

Chúng ta sẽ thấy được các thông tin chi tiết của HaskDisk: Drive Letter, Name, Total Size, Total free size, Format, Type, Volume Label...
Trong C#, có cung cấp cho chúng ta lớp DriveInfo(). Để chúng ta có thể truy vấn lấy thông tin dễ dàng.
Khi truy vấn vào DriveInfo() sẽ trả về cho chúng ta một danh sách mảng gồm các thuộc tính thông tin của ổ đĩa.
Chúng ta chỉ cần loop nó và hiển thị thông tin lên là OK.
Source code Get Information Hard Disk C#:
public partial class Form1 : Form
{
    public Form1()
    {
        InitializeComponent();
    }      
    private void Form1_Load(object sender, EventArgs e)
    {
        foreach (DriveInfo di in DriveInfo.GetDrives())
        {
            cboDrive.Items.Add(di.Name);
            cboDrive.SelectedIndex = 0;
        }
    }
    
    private void cboDrive_SelectedIndexChanged(object sender, EventArgs e)
    {
        string drive_letter = cboDrive.Text.Substring(0, 1);
        DriveInfo di = new DriveInfo(drive_letter);
        lblIsReady.Text = di.IsReady.ToString();
        lblDriveType.Text = di.DriveType.ToString();
        lblName.Text = di.Name;
        lblRootDirectory.Text = di.RootDirectory.Name;
        if (di.IsReady)
        {
            lblDriveFormat.Text = di.DriveFormat;
            lblAvailableFreeSpace.Text = convert.ToPrettySize(di.AvailableFreeSpace);
            lblTotalFreeSize.Text = convert.ToPrettySize(di.TotalFreeSpace);
            lblTotalSize.Text = convert.ToPrettySize(di.TotalSize);
            lblVolumeLabel.Text = di.VolumeLabel;
        }
        else
        {
            lblDriveFormat.Text = "";
            lblAvailableFreeSpace.Text = "";
            lblTotalFreeSize.Text = "";
            lblTotalSize.Text = "";
            lblVolumeLabel.Text = "";
        }
    }
}Thanks for watching!

![[C#] Hướng dẫn lấy thông tin dung lượng ổ đĩa Hard Disk trên windows](https://laptrinhvb.net/uploads/users/9a8cb514e4428e85fb4ca07588e9103f.png)

![[C#] Hướng dẫn tạo control động đơn giản trong Csharp](https://laptrinhvb.net/uploads/source/image_baiviet/3e6856446ede19b79fcd520b73223851.png)
![[C#] Hướng dẫn viết ứng dụng Magnification để phóng lớn hình ảnh trong lập trình csharp](https://laptrinhvb.net/uploads/source/csharp/magnification_thumb.jpg)
![[C#] Hướng dẫn sử dụng tài khoản Google Account đăng nhập vào hệ thống winform](https://laptrinhvb.net/uploads/source/csharp/login_google_csharp.png)

![[C#] Hướng dẫn sử dụng Factory trong Design Pattern](https://laptrinhvb.net/uploads/source/csharp/factory_pattern_thumb.png)
![[C#] Hướng dẫn sử dụng Row Filter trên DataView của DataTable](https://laptrinhvb.net/uploads/source/csharp/dataview_filter_csharp_thumb.jpg)
![[C#] Hướng dẫn cách viết sự kiện event cho usercontrol trong winform](https://laptrinhvb.net/uploads/source/csharp/envent_usercontrol_thumb.jpg)


![[C#] Mã hóa và giải mã Data Protection API trên winform](https://laptrinhvb.net/uploads/source/new_image_baiviet/DPAPI_encrypt_decrypt.png)
![[C#] Hướng dẫn Debug ứng dụng trong visual studio](https://laptrinhvb.net/uploads/source/csharp/debug_csharp_thumb%20(2).jpg)


![[C#] Hướng dẫn ghi thông tin cài đặt setting form vào file INI](https://laptrinhvb.net/uploads/source/image_baiviet/309fd2dd57c0094498088533bd131756.jpg)
![[C#] Tự động load user control vào form (Master layout C#)](https://laptrinhvb.net/uploads/source/image_baiviet/589c597b6aae2c9b9b821fdbd45fdac0.gif)
![[C#] Hướng dẫn thêm, lưu, xóa, sửa với Redis Database](https://laptrinhvb.net/uploads/source/csharp/redis_database_thumb.png)
![[C#] Di chuyển và thay đổi kích thước Control Winform khi ứng dụng đang chạy](https://laptrinhvb.net/uploads/source/new_image_baiviet/MOVE_RESIZE_THUMB.png)
![[C#] Giới thiệu ứng dụng RabbitMQ dùng để làm gì?](https://laptrinhvb.net/uploads/source/csharp/rabitMq_thumb.png)
![[C#] Hướng dẫn sử dụng từ khóa Params để truyền nhiều tham số vào hàm](https://laptrinhvb.net/uploads/source/csharp/params_csharp.png)
![[C#] Thay đổi icon cursor mouse mặc định trên Winform](https://laptrinhvb.net/uploads/source/csharp/change_cursor_csharp.gif)
![[C#] Hướng dẫn sử dụng thư viện Quartz lập lịch công việc hàng ngày](https://laptrinhvb.net/uploads/source/image_baiviet/3036de5d746ae1b36cdd04acca07f3d2.png)
![[C#] Hướng dẫn đọc Table trên file Microsoft Word vào Data Gridview](https://laptrinhvb.net/uploads/source/new_image_baiviet/READ_MS_WORD.png)
![[C#] Biến Cursor thành progress bar trên Winform](https://laptrinhvb.net/uploads/source/new_image_baiviet/cursor_progressbar.gif)
![[C#] Hướng dẫn tích hợp ứng dụng Notepad vào Winform](https://laptrinhvb.net/uploads/source/image_baiviet/364e3d7fe76255197cae5b07b9e1fff3.png)
![[C#] Flash Window in Taskbar Winform](https://laptrinhvb.net/uploads/source/vbnet/flash_windows_csharp.gif)
