最近在学DELPHI7时遇到了问题;代码运行无错误,但就是没反应,抓包工具也抓不到数据,关了防活墙,加了ANTIFREE组件也没用,不知什么原因,代码如下:
unit Unit1;interfaceuses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, OleCtrls, SHDocVw, IdBaseComponent, IdComponent,
IdTCPConnection, IdTCPClient, IdHTTP, StdCtrls;type
TForm1 = class(TForm)
    Button1: TButton;
    IdHTTP1: TIdHTTP;
    WebBrowser1: TWebBrowser;
    procedure Button1Click(Sender: TObject);
private
    { Private declarations }
public
    { Public declarations }
end;var
Form1: TForm1;implementation{$R *.dfm}
procedure TForm1.Button1Click(Sender: TObject);
var
no1:String;
no2:string;
PostURL     :String;
sParams     :String;
aParams     :TStrings;
aStream     :TStringStream;
beginIdHTTP1 := TIdHTTP.Create(nil);
aParams := TStringList.Create;
aStream := TStringStream.Create('');no1:='9' ;
no2:='222' ;
PostURL:='http://www.*****.com/factory/vote.aspx?r='+ no1; //提交网址
sParams:= 'uid='+no2; //参数
try
   aParams.Clear;
   aParams.Add(sParams);
   IdHTTP1.Request.ContentType := 'application/x-www-form-urlencoded';
   IdHTTP1.Post(PostURL, aParams, aStream); //提交
finally
    IdHTTP1.Free;
    aParams.Free;
    aStream.Free;
end;end;
end.