这个函数是什么?
将字符型IP地址变为整型IP地址

解决方案 »

  1.   

    var
      i,j,num: integer;
      s,ss: string;
      s1: array of string;
    begin
      s := edit1.text;
      setlength(s1,length(s));
      i := 0;
      while s <> '' do
      begin
        num := length(s);
        j := pos('.',s);
        if j <> 0 then
        begin
          s1[i] := copy(s,1,j-1);
          delete(s,1,j);
        end
        else
        begin
          s1[i] := s;
          delete(s,1,length(s));
        end;
        inc(i);
      end;
      for i := 0 to num-1 do
      begin
        ss := ss + s1[i]// 其中ss 就是你要的字符串类型的值,只是最后需要你进行一下转换罢了
      end;
    end;
      

  2.   

    procedure TForm1.Button1Click(Sender: TObject);
    var
       iIP : DWORD;
    begin
       iIP := inet_addr(PChar('215.22.133.22'));   ShowMessage(IntToStr( iIP));
    end;
      

  3.   

    iIP := inet_addr(PChar(ip));