Registriert seit: 9. Sep 2011
30 Beiträge
|
AW: Startzähler für Programm erstellen (Wichtig)
10. Sep 2011, 22:43
JAAAAA GESCHAFFT
Delphi-Quellcode:
unit Unit1;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls;
type
TForm1 = class(TForm)
Edit1: TEdit;
Button1: TButton;
procedure FormCreate(Sender: TObject);
procedure Button1Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form1: TForm1;
List: TStrings;
implementation
{$R *.dfm}
procedure TForm1.FormCreate(Sender: TObject);
begin
List := TStringList.Create;
try
List.LoadFromFile(' C:\Daten.txt');
if List.Count>0 then
Edit1.Text:=List[0];
finally
List.Free;
end;
end;
procedure TForm1.Button1Click(Sender: TObject);
begin
List := TStringList.Create;
try
List.Add(Edit1.Text);
List.SaveToFile(' C:\Daten.txt');
finally
List.Free;
end;
edit1.text := IntToStr(StrToIntDef(edit1.text, 0) + 1);
end;
end.
Oh man bin ich dumm
Geändert von Luckie (10. Sep 2011 um 22:48 Uhr)
|
|
Zitat
|