procedure TWatek.Execute;
begin
FPrzekaz:=TStringList.Create;
FreeOnTerminate:=true;
HTTP1:=TObslugaHTTP.Create(FForm);
rich1:=TStringList.Create;
rich2:=TStringList.Create;
rich3:=TStringList.Create;
rich4:=TStringList.Create;
rich5:=TStringList.Create;
while not (Application.Terminated) or (Terminated) do
begin
sleep(5000);
if FAttack then
zaatakuj;
if FLogging then
zaloguj;
end;
end;
i deklaracja zmiennych:
private
rich1:TStringList;
rich2:TStringList;
rich3:TStringList;
rich4:TStringList;
rich5:TStringList;
int1:integer;
int2:integer;
int3:integer;
str1:string;
str2:string;
str3:string;
FPrzekaz:TStringList;
FAttack:boolean;
FLogging:boolean;
FServer:string;
FParams:string;
FLogin:string;
FPassword:string;
FForm:TForm;
HTTP1:TObslugaHTTP;
Szukajka:TSzukajka2;
no tyle mam w moim programie a w klasie do obslugi INDY:
type
TObslugaHTTP = class
public
idhttp1:TidHTTP;
idCookieManager1:TIdCookieManager;
constructor Create(OBiekt:TComponent);
function Get (adres:string):string;
function Post (adres, co:string):string;
end;
constructor TObslugaHTTP.Create(OBiekt:TComponent);
begin
idhttp1:=TIdHTTP.Create(OBiekt);
idCookieManager1:=TIdCookieManager.Create(OBiekt);
idhttp1.HandleRedirects:=true;
idhttp1.CookieManager:=idCookieManager1;
idhttp1.Host:='www.emokillers.fora.pl';
idhttp1.Request.Accept:='application/xhtml+voice+xml;version=1.2, application'+
'/x-xhtml+voice+xml;version=1.2, text/html, application/xml;q=0.9, application'+
'/xhtml+xml, image/png, image/jpeg,image/gif, image/x-xbitmap, */*;q=0.1';
idhttp1.Request.AcceptLanguage:='pl,en;q=0.9';
idhttp1.Request.AcceptCharSet:='iso-8859-1, utf-8, utf-16, *;q=0.1';
//idhttp1.Request.AcceptEncoding:='deflate, gzip, x-gzip, identity, *;q=0,*.*';
idhttp1.Request.ContentType:='application/x-www-form-urlencoded';
idhttp1.Request.Connection:='Keep-Alive, TE';
end;
function TObslugaHTTP.Get(adres: string): string;
var
OutPut : TStringStream;
begin
Output := TStringStream.Create('');
try
idhttp1.Get(adres, Output);
Result:=output.DataString;
finally
Output.Free;
end;
end;
function TObslugaHTTP.Post(adres, co: string): string;
var
Output, Input : TstringStream;
begin
Output := TStringStream.Create('');
input := TStringStream.Create('');
input.WriteString(co);
try
idhttp1.Post(adres, Input, Output);
result := Output.DataString;
finally
Output.Free;
Input.Free;
end;
end;
no to jest chyba wszystko co ma cokolwiek wspolnego z obsluga internetu w moim programie. Korzystam z Turbo Delphi z jednego wzgledu... legalnosc softu. Nie stac mnie na inne wersje jeszcze wiec niestety ale amiana kompilatora odpada.
Dodam ze synchronizacje mam w programie na jaknajlepszym porzadku i nie ma z nia problemow. Problem pojawia sie wewnatrz watku :/ I nie mam pojecia czy watek moze sam sie wylaczyc po otrzymaniu bledu w komponencie TIdHTTP? Jesli nie to szukac bledu bede musial gdzies indziej...