DWORD Serial;
DWORD Length;
GetVolumeInformation("D:",NULL, MAX_PATH,&Serial,&
amp;Length, NULL,NULL,MAX_PATH);
CString StrSerial;
StrSerial.Format("%ud",Serial);
CFile logfile(_T("DiskID.log"), CFile::modeWrite|
CFile::modeCreate);
logfile.Write(StrSerial,StrSerial.GetLength());
logfile.Flush();
logfile.Close();
转载于:https://www.cnblogs.com/luyuxibaby/p/5217442.html
相关资源:C#实现读取指定盘符硬盘序列号的方法