#include "stdafx.h" #include<iostream> using namespace std; #include <Windows.h> LPTSTR namebuf=new char[12]; DWORD namesize=12; DWORD serialnumber; DWORD maxlen; DWORD fileflag; LPTSTR sysnamebuf=new char[10]; DWORD sysnamesize=10; //int num=m_disklist.GetItemCount(); int main() { ::GetVolumeInformation("C:\\",namebuf,namesize,&serialnumber,&maxlen,&fileflag, sysnamebuf,sysnamesize); cout << hex<< serialnumber<<endl; return 0; }