Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- procedure TForm3.Button3Click(Sender: TObject);
- type
- file1=Record
- fam:string[25];
- name:string[25];
- otec:string[25];
- login:string[25];
- pass:string[25];
- end;
- var
- f1:File of file1;
- x:file1;
- E:integer;
- K:string;
- G,J,V:Boolean;
- begin
- G:=true;
- J:=true;
- E:=0;
- V:=true;
- AssignFile(F1,'c:\file1.dat');
- Reset(F1);
- While not EOF(F1) do
- begin
- Read(F1,x);
- If x.login=Edit1.Text then
- begin
- K:=x.pass;
- E:=FilePos(F1);
- end;
- end;
- If (Edit2.Text='') OR (Edit3.Text='') OR (Edit4.Text='') then
- begin
- If Edit2.Text='' then col_warn(Edit2,'Не заполнено!',clwhite,clblack, V);
- If Edit3.Text='' then col_warn(Edit3,'Не заполнено!',clwhite,clblack, V);
- If Edit4.Text='' then col_warn(Edit4,'Не заполнено!',clwhite,clblack, V);
- end;
- If V=true then
- begin
- If Edit2.Text<>K then
- col_warn(Edit2,'Неверный пароль!',clwhite,clblack, G);
- If Edit3.Text<>Edit4.Text then
- col_warn(Edit4,'Пароли не совпадают!',clwhite,clblack, J);
- If (J=true) and (G=true) and (V=true) then
- begin
- Seek(F1,E-1);
- x.pass:=Edit3.Text;
- Write(F1,x);
- CloseFile(F1);
- ShowMessage('Пароль изменен!');
- end;
- end;
- end;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement