Registriert seit: 23. Mai 2005
312 Beiträge
|
Re: Visuelle Dekodierung
27. Dez 2005, 12:01
Hi,
Ich auch mal
Delphi-Quellcode:
const charset : string = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789';
...
function RandomString(const len: Integer; const CharSet: string): string;
var
i: Integer;
begin
SetLength(Result,len);
for i := 1 to len do
begin
Result[i] := CharSet[1+Random(Length(CharSet))];
end;
end;
function RandomChar(const CharSet: string): char;
begin
Result := CharSet[1 + Random(Length(CharSet))];
end;
procedure TForm1.Button1Click(Sender: TObject);
const
Text: string = 'DelphiPraxis';
var
i: Integer;
temp: string;
begin
label1.Caption := RandomString(length(text), charset);
repeat
sleep(20);
for i := 1 to length(text) do
begin
application.ProcessMessages;
if label1.Caption[i] <> text[i] then
begin
temp := label1.Caption;
temp[i] := RandomChar(charset);
label1.Caption := temp;
end;
end;
application.ProcessMessages;
until label1.Caption = text;
end;
hogge es hilft greetz
|
|
Zitat
|