获取列表:本机IP(ACE),本机符合条件硬盘

 

m_listCtrl.InsertColumn(0,"Driver",NULL,75);
 m_listCtrl.InsertColumn(1,"Free Space(M bytes)",NULL,155);
 TCHAR szDrives[128];
 TCHAR str[3];
 GetLogicalDriveStrings(128,szDrives);
 TCHAR * pDriver=szDrives;
 ULARGE_INTEGER disknum;
 while (*pDriver)
 {
  str[0]=*pDriver;
  str[1]=':';
  str[2]='/0';
  if (GetDriveType(str)==DRIVE_FIXED)
  {
   GetDiskFreeSpaceEx(str,&disknum,NULL,NULL);
   if ((disknum.QuadPart/(1024*1024))>MIN_FREE_SPACE)
   {
    UINT i=m_listCtrl.InsertItem(0,str);
    CString tempStr;
    tempStr.Format("%d",disknum.QuadPart/(1024*1024));
    m_listCtrl.SetItemText(i,1,tempStr.GetBuffer(0));
   }
  }
  pDriver+=4;
 }
 /////////////////
 m_listCtrl_1.InsertColumn(0,"Local IP Adrress",NULL,175);
 DWORD LocalIP[16];
 memset(LocalIP,0,16);
 TCHAR ip[16];
 CACEBase::GetLocalIP(LocalIP,16);
 PDWORD pIP=LocalIP;
 for (int i=0;i<16;i++)
 {
  if (LocalIP[i]==0)
  {
   break; 
  }
  CACEBase::ConvertIPToString(LocalIP[i],ip);
  m_listCtrl_1.InsertItem(0,ip);
 }

你可能感兴趣的:(获取列表:本机IP(ACE),本机符合条件硬盘)