Как сделать чтобы прокси проверялись по кругу,а то сколько загрузил прокси столько он и проверяет!
Вот код :
Код:
procedure TNewThread.Execute;
var CurAcc:integer;
data:Tstringlist;
HTTP:TIdHTTP;
begin
while Work do
begin
CS.Enter;
Inc(Acc);
if Acc<Mails.Count then CurAcc:=Acc else Work:=false;
CS.Leave;
if Work then
begin
{HTTP}
HTTP := TIdHTTP.Create(nil);
http.HandleRedirects:=false;
if Proxy.Text = '' then sleep(0) else //Если прокси не загружены, то ничего не делаем
begin
IP:= Copy(Proxy[CurAcc],1,Pos(':',Proxy[CurAcc])-1); Port:=Copy(Proxy[CurAcc],Pos(':',Proxy[CurAcc])+1,Length(Proxy[CurAcc]));
HTTP.ProxyParams.ProxyServer:=IP; //Вставляем прокси
HTTP.ProxyParams.ProxyPort:=strtoint(Port); //Вставляем порт
end;
Последний раз редактировалось Realizt; 09.12.2012 в 00:29.
varCurAcc:integer;
data:TStringStream;
idhttp:tidhttp;
http:thttpsend;
curproxy:integer;
begin
while Work do
begin
CS.Enter;
Inc(Acc);
inc(accproxy);
//
if form1.scheckbox1.checked=true then
begin
if accproxy<proxy.Count then
begin
curProxy:=accproxy;
end
else
accproxy:=-1;
end;
if Acc<source.Count then CurAcc:=Acc else Work:=false;
CS.Leave;
if Work then
varCurAcc:integer;
data:TStringStream;
idhttp:tidhttp;
http:thttpsend;
curproxy:integer;
begin
while Work do
begin
CS.Enter;
Inc(Acc);
inc(accproxy);
//
if form1.scheckbox1.checked=true then
begin
if accproxy<proxy.Count then
begin
curProxy:=accproxy;
end
else
accproxy:=-1;
end;
if Acc<source.Count then CurAcc:=Acc else Work:=false;
CS.Leave;
if Work then