type 部分
TMMThread =class(TThread)
tthreadid:integer;
tthreadtype:integer;
urlStr :String;
ttpostdata :TStrings;
ttresponses : TStringStream;
constructor Create(ttid:integer;typeflag:integer;url:String;postdate:TStrings;responses : TStringStream);
procedure Execute; override;
end;{ TMMThread }constructor TMMThread.create(ttid:integer;typeflag:integer;url:String;postdate:TStrings;responses : TStringStream);
begin
inherited Create(True);
FreeOnTerminate:=True;
Suspended:=false;
tthreadid:=ttid;
tthreadtype:=typeflag;
urlStr :=url;
ttpostdata :=postdate;
ttresponses := responses;end;
procedure TMMThread.Execute;
var
thIdHTTP: TIdHTTP;
begin
try
thIdHTTP := TIdHTTP.Create(nil);
if tthreadtype =1 then
begin
thIdHTTP.HandleRedirects := True;
thIdHTTP.Request.ContentType := 'application/x-www-form-urlencoded' ;
thIdHTTP.Post(urlStr,ttpostdata,ttresponses);
end
else if tthreadtype =2 then
begin
thIdHTTP.get(urlStr,ttresponses);
end;
finally
thIdHTTP.free;
end;
end;var
Responses : TStringStream ;
PostData: TStrings;
surl,tt :string;
addThread :TMMThread;调用部分
surl := 'http://'+serverurl+'/game/reg/login2.php';
addThread:=TMMThread.Create(1,1,surl,PostData, Responses);可是
thIdHTTP.Post(urlStr,ttpostdata,ttresponses);
执行异常!!
哪位高手帮忙看看啊
TMMThread =class(TThread)
tthreadid:integer;
tthreadtype:integer;
urlStr :String;
ttpostdata :TStrings;
ttresponses : TStringStream;
constructor Create(ttid:integer;typeflag:integer;url:String;postdate:TStrings;responses : TStringStream);
procedure Execute; override;
end;{ TMMThread }constructor TMMThread.create(ttid:integer;typeflag:integer;url:String;postdate:TStrings;responses : TStringStream);
begin
inherited Create(True);
FreeOnTerminate:=True;
Suspended:=false;
tthreadid:=ttid;
tthreadtype:=typeflag;
urlStr :=url;
ttpostdata :=postdate;
ttresponses := responses;end;
procedure TMMThread.Execute;
var
thIdHTTP: TIdHTTP;
begin
try
thIdHTTP := TIdHTTP.Create(nil);
if tthreadtype =1 then
begin
thIdHTTP.HandleRedirects := True;
thIdHTTP.Request.ContentType := 'application/x-www-form-urlencoded' ;
thIdHTTP.Post(urlStr,ttpostdata,ttresponses);
end
else if tthreadtype =2 then
begin
thIdHTTP.get(urlStr,ttresponses);
end;
finally
thIdHTTP.free;
end;
end;var
Responses : TStringStream ;
PostData: TStrings;
surl,tt :string;
addThread :TMMThread;调用部分
surl := 'http://'+serverurl+'/game/reg/login2.php';
addThread:=TMMThread.Create(1,1,surl,PostData, Responses);可是
thIdHTTP.Post(urlStr,ttpostdata,ttresponses);
执行异常!!
哪位高手帮忙看看啊
解决方案 »
- Function needs result type 明明有 result...
- 关于Field value required的错误,求助
- 简单的文本内容分类
- 动态创建Tchart控件问题,高手请进!
- 菜鸟问题,解决立马给分!字符串第一行信息如何提取?
- 为什么使用Olecontainer控件开了一个word,切换到另外一个word事例(本地运行一个word),再切换回来Olecontainer控件中的word,所有的操作就
- 怎样修改桌面图标
- VC与Delphi类型转换问题?
- 请教一个SQL语言的小问题?200分送上。
- sockconnection断开连接
- 请教Indy9和Indy10的问题.一个很简单的TCP连接的程序.我用Indy9可以执行成功.换到Indy10以后,相同的写法,却老是连不上Server,变化有这么
- 报表:QuickRep如何实现象Excel那样可以选择性的选择某些列来打印?
PostData := TStringList.Create;
分配资源没?