用套接字clientsocket去连吧,如果没有返回错误就连上了,端口就开的

解决方案 »

  1.   

    用winexec实现netstat -an命令怎么样
    temp:string;
    f:file of byte;
    size:integer;
    begin
      memo1.lines.clear;
      if fileexist(temp) then
        deletefile(temp);
    winexec(pchar(command.com/c netstat -an>'+temp),sw_hide);
    while not filexists(temp) do
      sleep(3000);
    try  
      assignfile(f,temp);
      reset(f);
      size:=filesize(f);
     finally 
       closefile(f);
     end;
     if size:=0 then
       begin
         showmessage('')
       end
        else
        try
           memo1.lines.loadfromfile(temp);
         except
        end;end;
      

  2.   

    Procedure LongIPToShort(aLongIPAddress : String; Out ShortIPAddress : String; out PortNumber : Integer);   var I, DotPos, tempPort : Integer;   var tempAddy, temp : String;   var TempStr : String;   begin   tempAddy := '';   tempStr := '';   //Determine if the sender of the long IP is using , or . as the   // Delimator     if (POS(',', aLongIPAddress) <> 0) then TempStr := ','   else TempStr := '.';     For I := 1 to 4 do   begin   DotPOS := POS(TempStr, aLongIPAddress);   tempAddy := tempAddy + (Copy(aLongIPAddress, 1, (DotPos - 1)));   If I <> 4 then TempADdy := TempAddy + '.';   Delete(aLongIpAddress, 1, DotPos);   end;   DotPos := Pos(TempStr, aLongIpAddress);   temp := Copy(aLongIpAddress, 1, (DotPos - 1));   tempPort := (StrToInt(temp) * 256);   Delete(aLongIpAddress, 1, DotPos);   TempPort := tempPort + StrToInt(ALongIpAddress);   ShortIPAddress := TempADdy;   PortNumber := tempPort;   end;   
      

  3.   

    : weilingjun1976(一休不休) 写的是什么东西亚?
      

  4.   

    超级终端中选择TCP/IP,该默认的23端口为21,输入IP地址,确定后看能不能连接就知道了
      

  5.   

    > sensation(sensation
    >用套接字clientsocket去连吧,如果没有返回错误就连上了,端口就开的用这种方法是可以的.
    只是ClientSocket要同步方式.
    我做过,对一个IP区段,端口区段扫描就只是简单用了这种方法,
    开多线程,并不慢.我用它来扫描完一个局域网,一会儿就完了.