delphi Get_HD_Serial() 获得磁盘驱动器序列号


本文整理自网络,侵删。

 
{获得磁盘驱动器序列号} 

function Get_HD_Serial(const Drivedir: Char): string; 
var 
  Nu: DWORD; 
  Vf: DWORD; 
  VolumeInfo: array[0..MAX_PATH] of Char; 
  V_n: DWORD; 
begin 
  GetVolumeInformation(PChar(Drivedir + ':\'), nil, SizeOf(VolumeInfo), @V_n,Nu, Vf, nil, 0); 
  Result := Format('%x-%x',[HiWord(V_n),LoWord(V_n)]); 
 // Result := Format('%8.0X', [V_n]) 
end; 
//格式化硬盘卷标ID号会改变

调用

Caption:=Get_HD_Serial('c') ;

相关阅读 >>

Delphi 取出鼠百标点击的 stringgrid 中某单度元格的值

Delphi monthoftheyear、weekoftheyear、weekofthemonth、dayoftheyear … 相对时间

Delphi 中拖动无边框窗口的5种方法

Delphi获取进程pid

Delphi xe2 将域名转ip

Delphi 查看指定文件是否在进程列表中

Delphi fmx app 设置 程序图标,闪屏,程序名

Delphi 控制台base64加密解密

Delphi 关于位图的像素格式

Delphi xe8在firemonkey tlistbox中显示图像

更多相关阅读请进入《Delphi》频道 >>



打赏

取消

感谢您的支持,我会继续努力的!

扫码支持
扫码打赏,您说多少就多少

打开支付宝扫一扫,即可进行扫码打赏哦

分享从这里开始,精彩与您同在

评论

管理员已关闭评论功能...