Форум по Delphi программированию

Delphi Sources



Вернуться   Форум по Delphi программированию > Все о Delphi > [ "Начинающим" ]
Ник
Пароль
Регистрация <<         Правила форума         >> FAQ Пользователи Календарь Поиск Сообщения за сегодня Все разделы прочитаны

 
 
Опции темы Поиск в этой теме Опции просмотра
  #1  
Старый 25.09.2011, 14:46
Tom Tom вне форума
Прохожий
 
Регистрация: 17.09.2011
Сообщения: 15
Репутация: 10
По умолчанию Напишите коментарии к листингу программе

опишите программный код пожалуйста. Заранее огромное спасибо.

Код:
unit Unit1;

interface

uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, StdCtrls;

type
  TForm1 = class(TForm)

    Button1: TButton;
    Button2: TButton;
    procedure Button1Click(Sender: TObject);
    procedure Button2Click(Sender: TObject);

  private
    { Private declarations }
  public
    { Public declarations }
  end;
unit Unit2;

interface

uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, StdCtrls, inifiles;

type
  TForm2 = class(TForm)
    Edit1: TEdit;
    Edit2: TEdit;
    Label1: TLabel;
    Label2: TLabel;
    Edit3: TEdit;
    Label3: TLabel;
    Button1: TButton;
    Label4: TLabel;
    ComboBox1: TComboBox;
    Label5: TLabel;
    Edit4: TEdit;
    Label6: TLabel;
    procedure Button1Click(Sender: TObject);

  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  Form2: TForm2;

implementation

{$R *.dfm}

procedure TForm2.Button1Click(Sender: TObject);

var
  fio,a:string;
  b,c:string;
  f: textFile;
  pref:integer;
  Ini: Tinifile;
begin
Ini:=TiniFile.Create(extractfilepath(paramstr(0))+'MyIni.ini');
fio:=Edit1.Text;
a:=Edit1.Text;
b:=Edit2.Text;
c:=Edit3.Text;
if b<>c then  label4.Caption:='Пароли не совпадают.'
   else label4.Caption:='Регистрация успешно завершина.';
case combobox1.itemindex of
0:pref:=1;
1:pref:=2;
2:pref:=3;
end;
Ini.WriteString('login','log',a);
Ini.Writestring('login','parol',b);
Ini.WriteInteger('login','pref',pref);
Form2.Close;
end;



end.
unit Unit3;

interface

uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, StdCtrls, inifiles;

type
  TForm3 = class(TForm)
    Edit1: TEdit;
    Label1: TLabel;
    Label2: TLabel;
    Edit2: TEdit;
    Button1: TButton;
    Label3: TLabel;
    procedure Button1Click(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  Form3: TForm3;

implementation

uses Unit4;

{$R *.dfm}

procedure TForm3.Button1Click(Sender: TObject);
var
a,b:string;
log,parol:string;
Ini: Tinifile;
c:integer;
f:string;
begin
Ini:=TiniFile.Create(extractfilepath(paramstr(0))+'MyIni.ini');
a:=Ini.Readstring('login','log','default value');
b:= Ini.Readstring('login','parol','default value');
c:=Ini.Readinteger('login','pref',10);
str(c,f);
log:=edit1.Text;
parol:=edit2.text;
if (a=log) and (b=parol) then begin
Form4:=TForm4.Create(Application);
 Form4.Caption:='Вход';
 Form4.Visible:=true;
 form4.Label1.Caption:='уровень доступа='+f;
 end else label3.caption:='логин или пароль не верны';
end;

end.
unit Unit4;

interface

uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, StdCtrls;

type
  TForm4 = class(TForm)
    Label1: TLabel;
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  Form4: TForm4;

implementation

{$R *.dfm}

end.
Админ: Пользуемся тегами для оформления кода!

Последний раз редактировалось Admin, 25.09.2011 в 14:56.
Ответить с цитированием
 


Delphi Sources

Опции темы Поиск в этой теме
Поиск в этой теме:

Расширенный поиск
Опции просмотра

Ваши права в разделе
Вы не можете создавать темы
Вы не можете отвечать на сообщения
Вы не можете прикреплять файлы
Вы не можете редактировать сообщения

BB-коды Вкл.
Смайлы Вкл.
[IMG] код Вкл.
HTML код Выкл.
Быстрый переход


Часовой пояс GMT +3, время: 19:42.


 

Сайт

Форум

FAQ

Соглашения

Прочее

 

Copyright © Форум "Delphi Sources" by BrokenByte Software, 2004-2025