您现在的位置:首页 >> 网络通讯 >> 网络通讯 >> 内容

Delphi中的DNS操作单元

时间:2011/9/3 15:12:58 点击:

  核心提示:function GetDnsIp : string;var Output : TStringList; DnsIp, CmdLine : string;begin CmdLine := GetIpC...
function GetDnsIp : string;
var
  Output : TStringList;
  DnsIp,
  CmdLine : string;
begin
  CmdLine := GetIpCfgExePath;
  if CmdLine <> '' then
  begin
    Output := TStringList.Create;
    try
      case GetBasicOsType of
        VER_PLATFORM_WIN32_WINDOWS :
        begin
          GetConsoleOutput (CmdLine, Output);
          Output.LoadFromFile (GetIpCfg9xOutPath);
        end;
        else
          GetConsoleOutput (CmdLine, Output);
      end;
      if GetDnsIpFromIpCfgOut (Output, DnsIp) then
        Result := DnsIp
      else
      begin
        Result := GetDnsIpFromReg;
      end;
    finally
      Output.Free;
    end;
  end;
end;

end.
全部单元代码已经打包



迅雷专用高速下载

作者:网络 来源:转载
共有评论 0相关评论
发表我的评论
  • 大名:
  • 内容:
  • 盒子文章(www.2ccc.com) © 2024 版权所有 All Rights Reserved.
  • 沪ICP备05001939号