Einzelnen Beitrag anzeigen

Benutzerbild von lbccaleb
lbccaleb

Registriert seit: 25. Mai 2006
Ort: Rostock / Bremen
2.037 Beiträge
 
Delphi 7 Enterprise
 
#14

Re: Security Software

  Alt 24. Jun 2008, 17:50
du kannst auch ne menge units aus deinem programm verbannen, um die datei grösse zu reduzieren...
du verwendest eh keine befehle aus diesen units...

hab sie mal markiert:

Delphi-Quellcode:
program Security1Beta;

{$APPTYPE CONSOLE}

uses
  Windows,
  SysUtils; // das sind die einzigen verwendeten units, der rest ist nicht in verwendung
             // das verringert deine dateigrösse von rund 361kb auf rund 43kb
// Messages,
// Variants,
// Classes,
// Graphics,
// Controls,
// Forms,
// Dialogs,
// StdCtrls,
// shellapi;

var
  Passwort,
  compname,
  test: String;
  Wrongcount: Integer = 0;

label anfang, ende, EnterComputerName;

begin
  if DirectoryExists(test+'_Desktop') then WrongCount := 4;
anfang:
  Write('Please enter Password to access: ');
  ReadLn(Passwort);
  writeln;
  if (passwort = 'passwort1') and (wrongcount < 4) then
    begin
      writeln('Access...');
      goto ende;
    end
  else if wrongcount < 4 then
    begin
      writeln('Access denied!!! You can try one more.');
      inc(wrongcount);
    end
  else
    begin
      writeln('Access to all functions of the program will be blocked...');
      writeln('Another entering the password is no longer possible.');
      EnterComputerName:
      CreateDir(test+'_Desktop');
      writeln('Please identify yourself as the owner of this computer.');
      writeln;
      write('Please enter the computer name: ');
      ReadLn(compname);
      if compname = GetEnvironmentVariable('USERDOMAIN') then
        begin
          writeln;
          writeln('Computer name is checked...');
          writeln;
          writeln('Computer name confirmed.');
          RemoveDir(test+'_Desktop');
          wrongcount:= 0;
          writeln;
          goto anfang;
        end
      else
        begin
          writeln;
          writeln('Computer name is checked...');
          writeln;
          writeln('Wrong input.');
          writeln('Full closure is initialized...');
          writeln('Full closure in Progress...');
          CreateDir(test+'_Lokale Einstellungen');
          writeln('Full closure complete.');
          goto EnterComputerName
        end;
    end;
    writeln;
    goto anfang;
ende:
  writeln;
  write('To end the program press enter.');
  ReadLn;
end.

eine frage aber noch:
wozu soll dieses programm genau sein, und was hat das mit sicherheit zu tun??
Martin
MFG Caleb
TheSmallOne (MediaPlayer)
Die Dinge werden berechenbar, wenn man die Natur einer Sache durchschaut hat (Blade)
  Mit Zitat antworten Zitat