有谁用过 IdHttp 的post方法调用 asp 页面提交数据

nzy2000 2004-02-21 11:01:49
有谁用过 IdHttp 的post方法调用 asp 页面提交数据
...全文
95 点赞 收藏 6
写回复
6 条回复
切换为时间正序
当前发帖距今超过3年,不再开放新的回复
发表回复
zhuangbx220 2004-09-07
type regThread=class(TThread)
private
IdHTTPreg:TIdHTTP;
fs:TFileStream;
Response : TStringStream;
st:TStringList;
bmp: TBITMAP;
FUserID:string;
FUserPassword:string;
FN:string;
FEnd:boolean;
public
constructor Create;
destructor Destroy; override;
procedure Execute; override;
property RegeditEnd:boolean read FEnd;
property UserID:string read FUserID;
property UserPassword:string read FUserPassword;
end;

constructor regThread.Create;
var
i:integer;
begin
inherited Create(false); //false 创建后立即执行
FreeOnTerminate:=false; //false 不自动结束线程
FEnd:=false;i:=0;
fn:=format('%.4d.~tmp',[i]);
while FileExists(fn) do
begin
inc(i);
fn:=format('%.4d.~tmp',[i]);
end;
IdHTTPreg:=TIdHTTP.Create(nil);
Response := TStringStream.Create('');
bmp:=TBITMAP.Create;
st:=TStringList.Create;
fs:=TFileStream.Create(fn,fmCreate or fmShareDenyWrite);
end;

destructor regThread.Destroy;
begin
IdHTTPreg.Free ;
Response.Free ;
st.Free ;
bmp.Free ;
if fs<>nil then fs.Free;
deletefile(fn);
inherited Destroy;
end;

procedure regThread.Execute;
var
sPOST,t,sCookie,sVerify,sNick:string;
i:integer;
begin
idHttpreg.Post('http://网址/regpayinfo.asp',st,Response);//提交注册信息 第1页
end;
回复
fw0011 2004-04-09
mark
回复
mark
回复
Lfrazy 2004-03-23
学习
回复
jie115 2004-03-22
procedure TWebOffice.WebSave;
var
mBakFileName:WideString;
mSfs:TFileStream;
begin
if not (WebOfficeImpl.FFileDesource<>'') then
begin
ShowMessage('保存文件地址没有设置,文档无法保存,请确认!');
exit;
end;
mBakFileName:=TempDir() + WebOfficeImpl.FFileName ;
WebBrowser.OleObject.Document.Application.ActiveDocument.SaveAs(mBakFileName);
while WebBrowser.Busy do
Application.ProcessMessages;
FreeAndNil(WebBrowser);
mSfs:=TFileStream.Create(mBakFileName, fmOpenRead or fmShareDenyWrite);
//发送数据
self.IdHTTP.Post(WebOfficeImpl.FFileDesource, mSfs);
//返回消息提示
showmessage(self.IdHTTP.ResponseText );
FreeAndNil(mSfs);
DeleteFile(mBakFileName);
end;
回复
iamqqmyheart 2004-03-19
谢谢zuping(臭虫) ,又学到一招!
回复
相关推荐
发帖
网络通信/分布式开发
创建于2007-08-02

1573

社区成员

Delphi 网络通信/分布式开发
申请成为版主
帖子事件
创建了帖子
2004-02-21 11:01
社区公告
暂无公告