close
using System.Management;
private void button1_Click(object sender, EventArgs e)
{
WqlObjectQuery wmiquery = new WqlObjectQuery("SELECT * FROM Win32_LogicalDisk WHERE DeviceID = 'e:'");
ManagementObjectSearcher wmifind = new ManagementObjectSearcher(wmiquery);
foreach (ManagementObject mobj in wmifind.Get())
{
string a = ("磁片類型: " + mobj["Description"].ToString());
string b = ("分區類型: " + mobj["FileSystem"].ToString());
string c = ("可用空間: " + mobj["FreeSpace"].ToString());
string d = ("實際大小: " + mobj["Size"].ToString());
}
}
----------------------------------------------------------------------------------------------------------------
ShineingShare
在台灣的高速雲端
完全免費
不須註冊帳號
無限檔案空間
無下載流量限制
網站 : http://www.shineingshare.com/
文章標籤
全站熱搜
留言列表