Advertisement
Guest User

...

a guest
Oct 21st, 2011
101
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Delphi 1.29 KB | None | 0 0
  1. procedure TForm3.Button3Click(Sender: TObject);
  2. type
  3.   file1=Record
  4.         fam:string[25];
  5.         name:string[25];
  6.         otec:string[25];
  7.         login:string[25];
  8.         pass:string[25];
  9.   end;
  10. var
  11.   f1:File of file1;
  12.   x:file1;
  13.   E:integer;
  14.   K:string;
  15.   G,J,V:Boolean;
  16. begin
  17. G:=true;
  18. J:=true;
  19. E:=0;
  20. V:=true;
  21. AssignFile(F1,'c:\file1.dat');
  22. Reset(F1);
  23. While not EOF(F1) do
  24.   begin
  25.   Read(F1,x);
  26.   If x.login=Edit1.Text then
  27.     begin
  28.     K:=x.pass;
  29.     E:=FilePos(F1);
  30.     end;
  31.   end;
  32. If (Edit2.Text='') OR (Edit3.Text='') OR (Edit4.Text='') then
  33.   begin
  34.     If Edit2.Text='' then col_warn(Edit2,'Не заполнено!',clwhite,clblack, V);
  35.     If Edit3.Text='' then col_warn(Edit3,'Не заполнено!',clwhite,clblack, V);
  36.     If Edit4.Text='' then col_warn(Edit4,'Не заполнено!',clwhite,clblack, V);
  37.   end;
  38. If V=true then
  39.   begin
  40.   If Edit2.Text<>K then
  41.     col_warn(Edit2,'Неверный пароль!',clwhite,clblack, G);
  42.   If Edit3.Text<>Edit4.Text then
  43.     col_warn(Edit4,'Пароли не совпадают!',clwhite,clblack, J);
  44.   If (J=true) and (G=true) and (V=true) then
  45.     begin
  46.     Seek(F1,E-1);
  47.     x.pass:=Edit3.Text;
  48.     Write(F1,x);
  49.     CloseFile(F1);
  50.     ShowMessage('Пароль изменен!');
  51.     end;
  52.   end;
  53. end;
  54.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement