Z
zzandyzh
Unregistered / Unconfirmed
GUEST, unregistred user!
procedure TSendThread.Execute;
var
Request : TStrings;
begin
while snum<=enumdo
begin
application.ProcessMessages;
sleep(1);
try
idhttp:=tidhttp.Create(nil);
Synchronize(setdata);
//一个过程
idhttp.CookieManager:=IdCookieManager1;
idhttp.HandleRedirects:=true;
idhttp.AllowCookies:=true;
idhttp.ReadTimeout:=strtoint(trim(form1.edit27.text));
//设置超时
//设置代理服务
if form1.CheckBox1.Checked then
begin
idhttp.ProxyParams.ProxyServer:=trim(form1.Edit5.Text);
idhttp.ProxyParams.ProxyPort:=strtoint(trim(form1.Edit6.text));
if form1.CheckBox2.Checked then
begin
idhttp.ProxyParams.ProxyUsername:=form1.Edit8.Text;
idhttp.ProxyParams.ProxyPassword:=form1.Edit9.Text;
end;
end;
synchronize(Setdatas); //一个过程
Request := TStringList.Create ;
request.Clear ;
request.add(trim(form1.edit13.text)+'='+(form1.edit2.text))
request.Add(trim(form1.edit15.text)+'='+(edits))
request.Add(trim(form1.edit12.text)+'='+(form1.Edit1.Text));
request.Add(trim(form1.edit14.text)+'='+(form1.Edit3.Text));
//打开链接
if trim(form1.edit24.text)<>'' then
begin
try
html1:=idhttp.Get(url);
except
idhttp.Disconnect;
continue;
end;
end;
try
html:=idhttp.Post(eurl,request);
except
idhttp.Disconnect;
continue;
end;
form1.Memo4.Text:=html;
idhttp.OnRedirect:=IdHTTPRedirect;
finally
request.Free;
idhttp.Free;
end;
application.ProcessMessages;
sleep(100);
end;
end;
为什么运行时点用Cpu资源100%?没多少分了,全给了!
var
Request : TStrings;
begin
while snum<=enumdo
begin
application.ProcessMessages;
sleep(1);
try
idhttp:=tidhttp.Create(nil);
Synchronize(setdata);
//一个过程
idhttp.CookieManager:=IdCookieManager1;
idhttp.HandleRedirects:=true;
idhttp.AllowCookies:=true;
idhttp.ReadTimeout:=strtoint(trim(form1.edit27.text));
//设置超时
//设置代理服务
if form1.CheckBox1.Checked then
begin
idhttp.ProxyParams.ProxyServer:=trim(form1.Edit5.Text);
idhttp.ProxyParams.ProxyPort:=strtoint(trim(form1.Edit6.text));
if form1.CheckBox2.Checked then
begin
idhttp.ProxyParams.ProxyUsername:=form1.Edit8.Text;
idhttp.ProxyParams.ProxyPassword:=form1.Edit9.Text;
end;
end;
synchronize(Setdatas); //一个过程
Request := TStringList.Create ;
request.Clear ;
request.add(trim(form1.edit13.text)+'='+(form1.edit2.text))
request.Add(trim(form1.edit15.text)+'='+(edits))
request.Add(trim(form1.edit12.text)+'='+(form1.Edit1.Text));
request.Add(trim(form1.edit14.text)+'='+(form1.Edit3.Text));
//打开链接
if trim(form1.edit24.text)<>'' then
begin
try
html1:=idhttp.Get(url);
except
idhttp.Disconnect;
continue;
end;
end;
try
html:=idhttp.Post(eurl,request);
except
idhttp.Disconnect;
continue;
end;
form1.Memo4.Text:=html;
idhttp.OnRedirect:=IdHTTPRedirect;
finally
request.Free;
idhttp.Free;
end;
application.ProcessMessages;
sleep(100);
end;
end;
为什么运行时点用Cpu资源100%?没多少分了,全给了!