获取逻辑磁盘符

来源:互联网 发布:2015利用淘宝漏洞赚钱 编辑:程序博客网 时间:2024/05/18 11:26

 //第一种方法

 DWORD dwDrive;
 dwDrive = GetLogicalDrives();
 

//第二种方法

TCHAR RootPathName[MAX_PATH];
 ZeroMemory(RootPathName,sizeof(RootPathName));
 DWORD dwLen;
 dwLen = GetLogicalDriveStrings(MAX_PATH,RootPathName); 
 for(int i=0;i<(int)dwLen;i=i+4)
 {
  printf("LogDrivesString:%c%c%c/n",RootPathName[i],RootPathName[i+1],RootPathName[i+2]);
 }

原创粉丝点击