منتديات ولاية بشار
هل تريد التفاعل مع هذه المساهمة؟ كل ما عليك هو إنشاء حساب جديد ببضع خطوات أو تسجيل الدخول للمتابعة.


منتديات ولاية بشار منتدى تعليم وعام
 
الرئيسيةأحدث الصورالتسجيلدخول

 

 وضع كلمة السر في المشروع

اذهب الى الأسفل 
كاتب الموضوعرسالة
ben taib allaa




عدد المساهمات : 17
نقاط : 11856
تاريخ التسجيل : 11/07/2013
الموقع : http://delph.forumalgerie.net/

وضع كلمة السر في المشروع Empty
مُساهمةموضوع: وضع كلمة السر في المشروع   وضع كلمة السر في المشروع Icon_minitimeالجمعة يوليو 12, 2013 7:51 pm

وضع كلمة السر في المشروع
----------------------------------------
افتح معالج قواعد البيانات التابع لدلفي (أو دلفي خمسة الفرنسي)  
Module Base de données
اتجه الى ...
Fichier\Nouveau\Table...
من النافذة ...
Création de table
ثم الى ...
Paradox 7
ثم موافق
OK
من النافذة
----------------------------------------------
Création de table Paradox 7 : ( Sane titre )
وصف الحقول
Description des champs:
نوعية الحقول
---------------------------------------
| Nom de champ | Type | Taille | Index |
---------------------------------------
| Mot_de            |  A     |  12    |         |
---------------------------------------
هذا الجدول يحتوي على حقل واحد هو :
Mot_de
نوعه حرفي أي سلسلة حرفية ورقمية و حجمه 12 . تستطيع الزيادة أو نقصان في الحجم
---------------------------------------
خصائص الجدول
Propriiétés de table :
تحديد كلمة السر
Mot de passe
انقر على ...
Définir ...

----------------------------
كتابة كلمة السر :  19541962
Mot de passe principal :
اعادة كتابة كلمة السر :  19541962
Vérifier le mot de passe principal :
انقر على ...
Ok
----------------------------
انقر على ...
Enregistrer sous...
حفظ الملف باسم (Mot1) مع البرنامج أي في نفس المجلد
اغلاق المعالج

----------------------------------------
انشيء مشروع جديد باسمه و احفظه مع ملف قاعدة البيانات أي في نفس المجلد  ثم
ضع على الفورم هذه العناصر
Label1 , BitBtn1
----------------------------------
الوحدة الاولى
------------------------
unit UTest;
interface
uses
 Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
 StdCtrls, Buttons;
type
TForm1  = class(TForm)
   BitBtn1: TBitBtn;
   Label1: TLabel;
   procedure FormCreate(Sender: TObject);
   procedure BitBtn1Click(Sender: TObject);
 private
   { Déclarations privées }
 public
   { Déclarations publiques }
 end;
var
 Form1: TForm1;
implementation
uses UPaswordd;
{$R *.DFM}
procedure TForm1.FormCreate(Sender: TObject);
begin
Form1.Position := poScreenCenter;
Form1.BorderStyle := bsDialog;
Form1.BorderWidth := 20;
Form1.Color := clBtnFace;
Form1.BiDiMode := bdRightToLeft;
Form1.Font.Charset := ARABIC_CHARSET;
Form1.Font.Size := 12;
Form1.Font.Color := clBlack;
Form1.Font.Style := [fsBold];
Form1.Caption := 'برنامج كلمة السر';
Form1.Label1.Font.Charset := ARABIC_CHARSET;
Form1.Label1.Font.Size := 12;
Form1.Label1      .font.Color := clRed;
Form1.Label1.Font.Style := [fsBold];
Form1.Label1.Caption := 'دخول الى البرنامج';
Form1.BitBtn1.Kind := bkOk;
Form1.BitBtn1.ModalResult := mrOk;
Form1.BitBtn1.Caption := 'دخول';
end;
procedure TForm1.BitBtn1Click(Sender: TObject);
begin
PasswordDlg.ShowModal;   //.Show;
[ندعوك للتسجيل في المنتدى أو التعريف بنفسك لمعاينة هذا الرابط]
end;
end.
--------------------------------------------------------
لنموذج او الفورم كلمة السر
--------------------------------------------------------
أشر الى
Fichier\Nouveau
ظهور مربع الحوار هذا
Nouveaux éléments
من مربع الحوار حدد تبويب هذا
Dialogues
من مربع الحوار حدد هذا
Dialogue Mot de passe
انقر الزر موافق
OK
النموذج او الفورم
PasswordDlg
ضع عليه
Table1
وانقر على تابل نقرتين
ظهور المربع التالي
PasswordDlg.Table1
انقر باليمنى واختر من القائمة تالي
Ajouter tous les champs
واغلقه
--------------------------------------------------------
الوحدة الثانية
--------------------------------------------------------
unit UPaswordd;
interface
uses Windows, SysUtils, Classes, Graphics, Forms, Controls,
 StdCtrls, Buttons, Db, DBTables;
type
 TPasswordDlg = class(TForm)
   Label1: TLabel;
   Password: TEdit;
   OKBtn: TButton;
   CancelBtn: TButton;
   Table1: TTable;
   Table1Mot_de: TStringField;
   procedure FormClose(Sender: TObject; var Action: TCloseAction);
   procedure OKBtnClick(Sender: TObject);
   procedure Table1BeforeOpen(DataSet: TDataSet);
 private
   { Private declarations }
 public
   { Public declarations }
 end;
var
 PasswordDlg: TPasswordDlg;
implementation
uses Dialogs, Unit2;
{$R *.DFM}
procedure TPasswordDlg.FormClose(Sender: TObject;
 var Action: TCloseAction);
begin
// Form1.
end;

procedure TPasswordDlg.OKBtnClick(Sender: TObject);
begin
Table1.DatabaseName := '';
Table1.TableName := 'Mot1.db';
Table1.Open;
Table1.First;
if Password.Text = Table1Mot_de.Value then
begin
  Form2.Show;
  PasswordDlg.Hide;
end else
 ShowMessage('كلمة السر غير صحيحة');
Password.Text := '';
end;
procedure TPasswordDlg.Table1BeforeOpen(DataSet: TDataSet);
begin
Session.AddPassword('19541962');
end;
end.

--------------------------------------------------------------
الوحدة الثالثة
--------------------------------------------------------------
unit Unit2;
interface
uses
 Windows, Messages, SysUtils, Classes, Graphics, Controls,
 Forms, Dialogs, Menus;
type
 TForm2 = class(TForm)
   procedure FormClose(Sender: TObject; var Action: TCloseAction);
   procedure FormCreate(Sender: TObject);
   procedure FormDestroy(Sender: TObject);
   procedure Botoun1Click(Sender: TObject);
 private
   { Déclarations privées }
 public
   { Déclarations publiques }
 end;
var
 Form2: TForm2;
implementation
{$R *.DFM}
uses StdCtrls, Buttons, Unit3;
procedure TForm2.Botoun1Click(Sender: TObject);
begin
Form3.ShowModal;
end;
procedure TForm2.FormClose(Sender: TObject; var Action: TCloseAction);
begin
Application.Terminate;
end;
var
  Botoun1, Botoun2: TBitBtn;
procedure TForm2.FormCreate(Sender: TObject);
begin
Botoun1 := TBitBtn.Create(self);
Botoun1.Parent := Form2;
Botoun1.Left := 50;
Botoun1.Top := 100;
Botoun1.Height := 35;
Botoun1.Width := 140;
Botoun1.Kind := bkOk;
Botoun1.ModalResult := mrOk;
Botoun1.Font.Style := [fsBold];
Botoun1.Cursor := crHandPoint;
Botoun1.Caption := 'تغيير كلمة السر';
Botoun1.OnClick := Botoun1Click;
Botoun2 := TBitBtn.Create(self);
Botoun2.Parent := Form2;
Botoun2.Left := 200;
Botoun2.Top := 100;
Botoun2.Height := 35;
Botoun2.Width := 140;
Botoun2.Kind := bkClose;
Botoun2.ModalResult := mrNone;
Botoun2.Font.Style := [fsBold];
Botoun2.Cursor := crHandPoint;
Botoun2.Caption := 'خروج من البرنامج';
end;
procedure TForm2.FormDestroy(Sender: TObject);
begin
Botoun1.Free;
Botoun2.Free;
end;
end.
-----------------------------------------------------------------
ضع على الفورم 3
TEdit
ضع على الفورم 2
TBitBtn
-----------------------------------------------------------------
الوحدة الرابعة
----------------------------------------------------------------
unit Unit3;
interface
uses
 Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
 StdCtrls, Buttons, Db, Grids, DBGrids;
type
 TForm3 = class(TForm)
   Edit1: TEdit;
   Edit2: TEdit;
   BitBtn1: TBitBtn;
   Edit3: TEdit;
   BitBtn2: TBitBtn;
   Label1: TLabel;
   Label2: TLabel;
   Label3: TLabel;
   procedure BitBtn1Click(Sender: TObject);
   procedure BitBtn2Click(Sender: TObject);
   procedure FormShow(Sender: TObject);
   procedure FormCreate(Sender: TObject);
 private    { Déclarations privées }
 public    { Déclarations publiques }
 end;
var
 Form3: TForm3;
implementation
uses UPaswordd;
{$R *.DFM}
procedure TForm3.BitBtn1Click(Sender: TObject);
begin
PasswordDlg.Table1.Open;
PasswordDlg.Table1.first;
if Edit1.Text = PasswordDlg.Table1Mot_de.Value then
begin
 Edit1.Visible := false;
 Edit2.Visible := true;
 Edit3.Visible := true;
 BitBtn1.Visible := false;
 BitBtn2.Visible := true;
 Label3.Visible := true;
 Label2.Visible := true;
 Label1.Visible := false;
end else
 ShowMessage('كلمة السر غير صحيحة');
Edit1.Text := '';
end;
procedure TForm3.BitBtn2Click(Sender: TObject);
begin
with PasswordDlg do
begin
if Edit3.Text = Edit2.Text then
begin
  Table1.First;
  if Table1Mot_de.Value <> '' then Table1.Delete;
  Table1.First;
  Table1.Append;
  Table1Mot_de.Value := Edit2.Text;
  Table1.Post;
 end else
  ShowMessage('الكلمتان غير متسوايتان');
end;
end;
procedure TForm3.FormShow(Sender: TObject);
begin
Edit1.Visible := true;
Edit2.Visible := false;
Edit3.Visible := false;
BitBtn1.Visible := true;
BitBtn2.Visible := false;
Label2.Visible := false;
Label3.Visible := false;
Label1.Visible := true;
Edit1.Text := '';
Edit2.Text := '';
Edit3.Text := '';
end;
procedure TForm3.FormCreate(Sender: TObject);
begin
Form3.Caption := 'تغيير كلمة السر';
BitBtn1.Kind := bkOk;
BitBtn1.ModalResult := mrNone;
BitBtn2.Kind := bkOk;
BitBtn2.ModalResult := mrOk;
Label1.Caption := 'أدخل كلمة السر القديمة';
Label2.Caption := 'أدخل كلمة السر الجديدة';
Label3.Caption := 'أكد طلمة السر الجديدة';
end;
end.



-------------------------------
لمزيد من المعلومات زيارة المنتدى
delph.forumalgerie.net
delph forumalgerie net

.
الرجوع الى أعلى الصفحة اذهب الى الأسفل
http://delph.forumalgerie.net
 
وضع كلمة السر في المشروع
الرجوع الى أعلى الصفحة 
صفحة 1 من اصل 1
 مواضيع مماثلة
-
» وضع كلمة السر في المشروع

صلاحيات هذا المنتدى:لاتستطيع الرد على المواضيع في هذا المنتدى
منتديات ولاية بشار :: منتدى الكمبيوتر :: برامج الكمبيوتر والإنترنت-
انتقل الى: