1,593
社区成员
发帖
与我相关
我的任务
分享
function GetHtml(Url: string; Source: TStringList): integer;
var
IdHTTP: TIdHTTP;
Ans: string;
begin
Result := 0;
IdHTTP := TIdHTTP.Create(nil);
try
try
Ans := IdHTTP.Post(Url, Source);
Result := Length(Ans);
ShowMessage(Ans);
except
on E: Exception do
begin
//
end;
end;
finally
IdHTTP.Free;
end;
end;
var
Source: TStringList;
begin
Source := TStringList.Create;
try
Source.add('userid=xxx');
Source.add('password=xxx');
GetHtml('www.xxxx.com', Source);
finally
Source.Free;
end;
end;