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;

解决方案 »

  1.   

    问题已经解决了,但现在还有个新的问题,就是如何实现多线程
    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;
    这段代码就是我获取到的信息,但是现在我要多线程来实现,测试的时候发现,连接多点就出错了!!
      

  2.   

    IdHTTPServer CommandGet里面执行的本来就是多线程。没一个连接都有独立的AThread, TIdPeerThread,AResponseInfo,