AGB  ·  Datenschutz  ·  Impressum  







Anmelden
Nützliche Links
Registrieren
Zurück Delphi-PRAXiS Sprachen und Entwicklungsumgebungen Object-Pascal / Delphi-Language Delphi Problem bei meinem Loginsystem & der Hauptunit
Thema durchsuchen
Ansicht
Themen-Optionen

Problem bei meinem Loginsystem & der Hauptunit

Ein Thema von Back2Code · begonnen am 24. Feb 2012 · letzter Beitrag vom 24. Feb 2012
 
Benutzerbild von Back2Code
Back2Code

Registriert seit: 6. Feb 2012
Ort: Deutschland
272 Beiträge
 
Delphi XE7 Professional
 
#1

Problem bei meinem Loginsystem & der Hauptunit

  Alt 24. Feb 2012, 08:20
Delphi-Version: XE2
Hallo DP,

bei meiner neusten Übung ist ein kleines Loginsystem herausgekommen. (Unit3.pas). Der Code sieht wie folgt aus :

Delphi-Quellcode:
unit Unit3;

interface

uses
  Winapi.Windows, Winapi.Messages, System.SysUtils, System.Variants, System.Classes, Vcl.Graphics,
  Vcl.Controls, Vcl.Forms, Vcl.Dialogs, Vcl.StdCtrls, Vcl.Imaging.pngimage,
  Vcl.ExtCtrls, Vcl.ComCtrls, Unit1;

type
  TForm3 = class(TForm)
    Edit1: TEdit;
    Button1: TButton;
    Edit2: TEdit;
    Label1: TLabel;
    Label2: TLabel;
    Image1: TImage;
    Image2: TImage;
    procedure Button1Click(Sender: TObject);

  private
    { Private-Deklarationen }
  public
    { Public-Deklarationen }
  end;

var
  Form3: TForm3;
  trys: integer = 3;

const
    pwd = 'password';
    usr = 'admin';


implementation


{$R *.dfm}

procedure TForm3.Button1Click(Sender: TObject);
begin
  if (edit1.Text= pwd) and (edit2.Text= usr) then
  Form3.Caption:=('Correct password')
else
  Form3.Caption:=('Wrong password');
  trys := trys-1;
  if trys=0 then close();
end;

end.
Jetzt habe ich noch eine neue Unit hinzugefügt (VCL Anwendungsform Unit1.pas) und würde diese gerne nach erfolgreichem einloggen öffnen lassen und das Loginfenster sollte sich schließen. Wie verwirkliche ich das in der Praxis?


Geändert von Back2Code (24. Feb 2012 um 08:31 Uhr)
  Mit Zitat antworten Zitat
 


Forumregeln

Es ist dir nicht erlaubt, neue Themen zu verfassen.
Es ist dir nicht erlaubt, auf Beiträge zu antworten.
Es ist dir nicht erlaubt, Anhänge hochzuladen.
Es ist dir nicht erlaubt, deine Beiträge zu bearbeiten.

BB-Code ist an.
Smileys sind an.
[IMG] Code ist an.
HTML-Code ist aus.
Trackbacks are an
Pingbacks are an
Refbacks are aus

Gehe zu:

Impressum · AGB · Datenschutz · Nach oben
Alle Zeitangaben in WEZ +1. Es ist jetzt 08:21 Uhr.
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024 by Thomas Breitkreuz