|
; ok,ok2:integer; proto,user,pass,host,port,path: string; begin (*@/// parse url and proxy to f_hostname, f_path and f_socket_number *) if f_proxy<>'''''''' then begin parse_url(f_proxy,proto,user,pass,host,port,path); f_path:=f_url; if port='''''''' then port:=''''8080''''; end else begin parse_url(f_url,proto,user,pass,host,port,f_path); if port='''''''' then port:=''''80''''; end; if proto='''''''' then proto:=''''http''''; if path='''''''' then path:=''''/'''';
f_hostname:=host; f_Socket_number:=strtoint(port); (*@\\\*) login; sendrequest(''''POST'''',''''1.0''''); (*@/// Send the data *) TMemorystream(f_stream).seek(0,0); ok:=1; while ok>0 do begin ok:=f_stream.read(f_buffer^,buf_size); write_buf(f_socket,f_buffer^,ok); end; (*@\\\0000000607*) getanswer; (*@/// read in the response body *) TMemorystream(f_stream).clear; while not eof(f_socket) do begin read_var(f_socket,f_buffer^,buf_size,ok); p:=f_buffer; while ok>0 do begin (* just to be sure everything goes into the stream *) ok2:=f_stream.write(p^,ok); dec(ok,ok2); p:=pointer(longint(p)+ok2); end; end; f_stream.seek(0,0); (* set the stream back to start *) (*@\\\0000000201*) logout; end;
上一页 [1] [2] [Delphi程序]Delphi 程序员代码编写标准指南 (四) [Delphi程序]TCP/IP (五) [Delphi程序]TCP/IP (三) [Delphi程序]TCP/IP 使网络连接驱向简单化(二) [Delphi程序]TCP/IP 使网络连接驱向简单化 [VB.NET程序]用VB5 Winsock控件创建TCP\IP客户机 服务器程序 [MySql]Linux TCP/IP 协议栈源码分析(一)
|