Forum Discussion
jackson_1
15 years agoFrequent Contributor
hi;
i am done this scripts. share it there.
i am done this scripts. share it there.
function ResolveIP(ComputerName): string;
var
objShell,objExec,RegEx;
var
StrOutput: string;
begin
objShell: = Sys.OleObject['WScript.Shell'];
objExec: = objShell.Exec('Ping ' + ComputerName + ' -n 1');
StrOutput: = objExec.StdOut.ReadAll;
RegEx: = HISUtils.RegExpr;
RegEx.Expression: = '(\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3})';
Regex.Exec(StrOutput);
if RegEx.MatchPos[0] then
result: = RegEx.Substitute('$&')
else
result: = 'IP Address colud not be resolved.!';
end;