核心提示: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.
全部单元代码已经打包
迅雷专用高速下载