首页 电脑 电脑学堂 查看内容

MFC获取电脑硬盘序列号(附源码)

2015-3-13 17:53 1265 0

摘要: 在新建的工程里面添加一个类 即:以下一个类 GetHDSerial.cpp // GetHDSerial.cpp: implementation of the CGetHDSerial ...
关键词: nbsp IdIPWatch req plaincopyuses TIdIPWatch EmptyStr function Create delphi Result

[delphi] view plaincopyuses msxml, RegularExpressions;    function GetPublicIP:string;  var    req: IXMLHTTPRequest;  begin    req := CoXMLHTTP.Create;    req.open('get', 'http://city.ip138.com/ip2city.asp', False, EmptyStr, EmptyStr);    req.send('');    Result := TRegEx.Match(req.responseText, '[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}').Value;    end;   DelphiXE以上版本。 [delphi] view plaincopyuses IdIPWatch;    function GetNativeIP: String;  var    IdIPWatch: TIdIPWatch;  begin    IdIPWatch := TIdIPWatch.Create(nil);    try      Result := IdIPWatch.LocalIP;    finally      IdIPWatch.Free;    end;  end;   DelphiXE7下编写。
声明:文章版权归原作者所有 部分文章转自互联网 如有侵权请联系 [邮箱地址] 删除

路过

雷人

握手

鲜花

鸡蛋

最新评论

返回顶部