procedure TForm1.IdHTTPServerCommandGet(AThread: TIdPeerThread;
ARequestInfo: TIdHTTPRequestInfo; AResponseInfo: TIdHTTPResponseInfo);
var
LocalDoc:string;
ByteSent: Cardinal;
begin
//获取客户端发送过来的信息,他的信息里含有姓名、地址等信息,我怎么获取这个信息,当前这个控件能不能这样做
//如果不可以,有没有其他控件希望大家帮忙啊!
//获取了姓名,等信息后,我通过后台查询数据库,生成一个HTML的文件的
LocalDoc:=ExpandFileName(StaticText3.Caption+ARequestInfo.Document); //可执行程序地址
LocalDoc :=makehtml; //生成一个html文件
LocalDoc :=ExpandFileName(LocalDoc+FileNowName+'.html');//FileNowName 生成的文件名 if FileExists(LocalDoc) then
begin
if AnsiSameText(Copy(LocalDoc,1,Length(StaticText3.Caption)),StaticText3.Caption) then
begin
ByteSent:=IdHttpServer.ServeFile(AThread,AResponseInfo,LocalDoc);
end;
end;
MeMessage.Lines.Add(AReQuestInfo.Document);
end;
ARequestInfo: TIdHTTPRequestInfo; AResponseInfo: TIdHTTPResponseInfo);
var
LocalDoc:string;
ByteSent: Cardinal;
begin
//获取客户端发送过来的信息,他的信息里含有姓名、地址等信息,我怎么获取这个信息,当前这个控件能不能这样做
//如果不可以,有没有其他控件希望大家帮忙啊!
//获取了姓名,等信息后,我通过后台查询数据库,生成一个HTML的文件的
LocalDoc:=ExpandFileName(StaticText3.Caption+ARequestInfo.Document); //可执行程序地址
LocalDoc :=makehtml; //生成一个html文件
LocalDoc :=ExpandFileName(LocalDoc+FileNowName+'.html');//FileNowName 生成的文件名 if FileExists(LocalDoc) then
begin
if AnsiSameText(Copy(LocalDoc,1,Length(StaticText3.Caption)),StaticText3.Caption) then
begin
ByteSent:=IdHttpServer.ServeFile(AThread,AResponseInfo,LocalDoc);
end;
end;
MeMessage.Lines.Add(AReQuestInfo.Document);
end;
解决方案 »
- 如何获取HTTP 302重定向的header信息?
- 关于改delphi的工程文件(.dproj)的问题
- 生成助记码
- 关于图片文件存储到数据库的问题?
- 如何在AdvStringGrid中设定各列的 MaxEditLength 值?
- 如何批量去新增BDE中的数据库路径
- 如何画矢量线?并且这个或者这些矢量线是可以编辑的。
- 散分帖-终于有5条内裤了,从周一到周五,一天换一条,想穿那条穿那条,大礼拜光着
- access数据库之间复制记录
- 我下载了kylix,可是如何安装呢?
- 关于控件VclSkin的问题
- 为何Messages.pas里面有这样的定义case Integer of 0: ?这里的Integer类型怎么看起来作变量用了?
CoInitialize(nil);
if ARequestInfo.Command = 'GET' then
begin
if ARequestInfo.Params.Count > 0 then
begin
ARequestStr :=ARequestInfo.Params[0];
if AnsiContainsText(ARequestInfo.Params[0],'户号') then
begin
try
clientid:=strtoint(ARequestInfo.Params.Values['户号']);
except
application.MessageBox('户号含有非法字符!','提示信息');
exit;
end;
end;
end;
end;
这段代码就是我获取到的信息,但是现在我要多线程来实现,测试的时候发现,连接多点就出错了!!