TIdHTTP(你说的IdHTTP1) 是著名的网络组件indy中
你还可一用ICS网络组件, 用它向ASP提交数据也很方便。
你可用它THttpCli组件,
代码片段如:
----------------------------------------------------
procedure TForm1.Button1Click(Sender: TObject);
var
DataIn : TMemoryStream;
DataOut : TMemoryStream;
Buf : String;
i:integer;
begin
DataIn := TMemoryStream.Create;
DataOut := TMemoryStream.Create;
Buf := 'Account=' + Trim(LabeledEdit1.Text) +
'&PWD=' + Trim(LabeledEdit2.Text)+
'&submit1=submit1' ;
DataOut.Write(Buf[1], Length(Buf));
DataOut.Seek(0, soFromBeginning);
httpcli1.SendStream := DataOut;
httpcli1.RcvdStream := DataIn;
// httpcli1.ProxyPort := '80';
HttpCli1.URL := Edit1.Text;
try
Memo1.Clear;
Application.ProcessMessages;
try
httpcli1.Post;
finally
DataIn.Seek(0, 0);
Memo1.Lines.LoadFromStream(DataIn);
end;
finally
DataOut.Free;
DataIn.Free;
end;
ShowMessage('登陆完毕!!!');
end;