천객만래 [千客萬來] (It has an interminable succession of visitors)

'ip address'에 해당되는 글 1건

  1. 2017.02.12 [delphi] IP주소 유효성체크

[delphi] IP주소 유효성체크


20070326



function TForm1.IsValidIPAddress(strIP: String): Boolean;
var
TempList: TStringList;
i: Integer;
nTemp: Integer;
begin
Result := False;
TempList := TStringList.Create;

ExtractStrings(['.'], [], PAnsiChar(strIP), TempList);
if TempList.Count = 4 then
begin
   for i := 0 to 3 do
   begin
     nTemp := StrToIntDef(TempList[i], -1);
     if (nTemp < 0) or (nTemp > 255) then
     begin
       break;
     end;
   end;
   Result := True;
end;

TempList.Free;
end;


Posted by SB패밀리