procedure TWebServer.HTTPServerCommandGet(AThread: TIdPeerThread;
ARequestInfo: TIdHTTPRequestInfo; AResponseInfo: TIdHTTPResponseInfo);
var
UrlPar:Tstrings;
aaa:string;
begin
//EnterCriticalSection(MyCs); //进入临界区
try
AThread.FreeOnTerminate:=True;
UrlPar := TStringList.Create; //提交的参数 0 : host 1 : geturl 2 : refurl
UrlPar.CommaText := ARequestInfo.QueryParams;
if UrlPar.Count = 3 then
begin
JS:= Tidhttp.Create(nil);
JS.Disconnect;
JS.Free;
JS:= Tidhttp.Create(nil);
JS.ReadTimeout:=9000;
JS.ConnectTimeout:=9000;
JS.HandleRedirects:=True;
JS.AllowCookies:=True;
JS.Request.Accept:='application/x-shockwave-flash, image/gif, image/x-xbitmap, image/jpeg, image/pjpeg, */*';
JS.Request.UserAgent:='Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.2; SV1; .NET CLR 2.0.50727)';
JS.Request.Connection:='Keep-Alive';
JS.Request.AcceptEncoding:='gzip';
if UrlPar[2]<>'' then JS.Request.Referer:='http://'+UrlPar[0]+UrlPar[2];
aaa:=JS.Get('http://'+UrlPar[0]+UrlPar[1]);
if JS.Response.ContentEncoding='gzip' then AResponseInfo.ContentText:=ZLibExGZ.GZDecompressStr(aaa)
else AResponseInfo.ContentText:=aaa;
AResponseInfo.ContentText='OKOKOK';//加上这句后就不会有那些问题了,为什么???
//JS.Disconnect;
//JS.Free;
end;
finally
JS.Disconnect
//JS.Free; //if AThread.Suspended=True then AThread.Resume;
//AThread.Terminate;
//LeaveCriticalSection(MyCs); //离开临界区 end;//AThread.Free;
end;
ARequestInfo: TIdHTTPRequestInfo; AResponseInfo: TIdHTTPResponseInfo);
var
UrlPar:Tstrings;
aaa:string;
begin
//EnterCriticalSection(MyCs); //进入临界区
try
AThread.FreeOnTerminate:=True;
UrlPar := TStringList.Create; //提交的参数 0 : host 1 : geturl 2 : refurl
UrlPar.CommaText := ARequestInfo.QueryParams;
if UrlPar.Count = 3 then
begin
JS:= Tidhttp.Create(nil);
JS.Disconnect;
JS.Free;
JS:= Tidhttp.Create(nil);
JS.ReadTimeout:=9000;
JS.ConnectTimeout:=9000;
JS.HandleRedirects:=True;
JS.AllowCookies:=True;
JS.Request.Accept:='application/x-shockwave-flash, image/gif, image/x-xbitmap, image/jpeg, image/pjpeg, */*';
JS.Request.UserAgent:='Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.2; SV1; .NET CLR 2.0.50727)';
JS.Request.Connection:='Keep-Alive';
JS.Request.AcceptEncoding:='gzip';
if UrlPar[2]<>'' then JS.Request.Referer:='http://'+UrlPar[0]+UrlPar[2];
aaa:=JS.Get('http://'+UrlPar[0]+UrlPar[1]);
if JS.Response.ContentEncoding='gzip' then AResponseInfo.ContentText:=ZLibExGZ.GZDecompressStr(aaa)
else AResponseInfo.ContentText:=aaa;
AResponseInfo.ContentText='OKOKOK';//加上这句后就不会有那些问题了,为什么???
//JS.Disconnect;
//JS.Free;
end;
finally
JS.Disconnect
//JS.Free; //if AThread.Suspended=True then AThread.Resume;
//AThread.Terminate;
//LeaveCriticalSection(MyCs); //离开临界区 end;//AThread.Free;
end;
解决方案 »
- 关于 raize 控件
- 在DBGrid中,如何控制输入数据的格式?
- 如何显示TImage与TImageList的图象属性对话框
- Ehlib中3.1的DBGRIDEH设置问题1
- 一段程序!
- 大家好,请问如何知道当前ADODataSet是否有UpdateStatus为usDeleted的记录?
- 有关用DCOM联接的问题,我在自己的机子上行,为什么别人机子上不行,或都人家机子上联接不到我机子
- 如何使程序在OnClose时最小化?
- 六六大顺,答问题者个个顺
- 讨论:开发人员重装电脑需要一天时间了?
- 想学习一下 DELPHI 6,哪里有安装文件的下载地址?
- ListView中如何选中Checkboxes的时候选中本行呢?
HTTPDecode(HTTP解码)
-----------------------------------
UTF8Encode
Utf8ToUnicode
UTF8Decode
Utf8ToAnsi上下函数可以组合使用