1.關於PC的唯一標示不置可否的分析,2.獲取C盤硬盤號,3.QChar::Direction說明

1.關於PC的唯一標示不置可否的分析

怎麼獲取電腦唯一標識碼,網卡MAC地址不好使https://bbs.csdn.net/topics/390838655?list=lz

CPU序列號,從某個版本以後取到的都是統一的值,就是CPU型號,INTER不再提供唯一ID
硬盤序列號,某些電腦獲取不到,一執行獲取代碼就會出錯
MAC地址,不插網線時,有些系統獲取到的是空
所以都不是很可靠

 

2.獲取C盤硬盤號

https://bbs.csdn.net/topics/380173142


    QString lpRootPathName = "C:\\";
    LPTSTR lpVolumeNameBuffer=new TCHAR[12];//磁盤卷標
    DWORD nVolumeNameSize=12;// 卷標的字符串長度
    DWORD VolumeSerialNumber;//硬盤序列號
    DWORD MaximumComponentLength;// 最大的文件長度
    LPTSTR lpFileSystemNameBuffer=new TCHAR[10];// 存儲所在盤符的分區類型的長指針變量
    DWORD nFileSystemNameSize=10;// 分區類型的長指針變量所指向的字符串長度
    DWORD FileSystemFlags;// 文件系統的一此標誌

    GetVolumeInformation((LPTSTR)lpRootPathName.utf16(),
      lpVolumeNameBuffer, nVolumeNameSize,
      &VolumeSerialNumber, &MaximumComponentLength,
      &FileSystemFlags,
      lpFileSystemNameBuffer, nFileSystemNameSize);

    qDebug() << VolumeSerialNumber;
3.QChar::Direction說明

Enumerations

enum  
  FX::DirL = 0, 
  FX::DirLRE = 1, 
  FX::DirLRO = 2, 
  FX::DirR = 3, 
  FX::DirAL = 4, 
  FX::DirRLE = 5, 
  FX::DirRLO = 6, 
  FX::DirPDF = 7, 
  FX::DirEN = 8, 
  FX::DirES = 9, 
  FX::DirET = 10, 
  FX::DirAN = 11, 
  FX::DirCS = 12, 
  FX::DirNSM = 13, 
  FX::DirBN = 14, 
  FX::DirB = 15, 
  FX::DirS = 16, 
  FX::DirWS = 17, 
  FX::DirON = 18 
}

Enumeration Type Documentation

 

anonymous enum
 

Bidi types.

 

Enumeration values:

DirL  Left-to-Right.
DirLRE  Left-to-Right Embedding.
DirLRO  Left-to-Right Override.
DirR  Right-to-Left.
DirAL  Right-to-Left Arabic.
DirRLE  Right-to-Left Embedding.
DirRLO  Right-to-Left Override.
DirPDF  Pop Directional Format.
DirEN  European Number.
DirES  European Number Separator.
DirET  European Number Terminator.
DirAN  Arabic Number.
DirCS  Common Number Separator.
DirNSM  Non-Spacing Mark.
DirBN  Boundary Neutral.
DirB  Paragraph Separator.
DirS  Segment Separator.
DirWS  Whitespace.
DirON  Other Neutrals.

http://www.fox-toolkit.org/ref16/group__fxunicode__1.html#gga0a2173

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章