Autor Beitrag
counterto
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 123

Win XP
Delphi 2005 Prof., Visual Basic 2005, PHP, My Sql, Visual Basic 6
BeitragVerfasst: Mi 15.03.06 19:05 
hallo, ich programmiere schon seit längerem an einer Passwortdatenbank. Kurz das Prinzip:
Auf dem hauptfenster sieht man eine listbox mit allen Passwort einträgen. daneben 3 buttons: einer um einen neuen Passwort eintrag durchzufphren, einen um die PW liste zu speichern, und einen um die PW liste zu laden. Mit dem Button "Neuer eintrag" ruft man eine neue Form auf, auf der verschiedene edit felder sind. Nachdem man diese fertig ausgefüllt hat, drückt man auf einen button der die einträge aus den edit feldern, in die listbox(en) überträgt! So und hier liegt das problem. Ich habe folgenden Code angewand:
ausblenden Quelltext
1:
2:
ListBox1.addItem(username.text);
ListBox1.addItem(passwort.text);
usw..

Wenn ich jetzt das Programm starte, bringt er mir einen Fehler: [Pascal Fehler] Unit3.pas(48): E2035 Nicht genügend wirkliche Parameter

kann mir jmd helfen?

_________________
Computer werden den Menschen immer ähnlicher - sie können bald alles, außer denken.
Marco D.
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 2750

Windows Vista
Delphi 7, Delphi 2005 PE, PHP 4 + 5 (Notepad++), Java (Eclipse), XML, XML Schema, ABAP, ABAP OO
BeitragVerfasst: Mi 15.03.06 19:12 
Schreibe es lieber so:
ausblenden Delphi-Quelltext
1:
2:
ListBox1.add(username.text);
ListBox1.add(passwort.text);

_________________
Pascal keeps your hand tied. C gives you enough rope to hang yourself. C++ gives you enough rope to shoot yourself in the foot
der Berliner
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 417

Win Xp Home
delphi 2005
BeitragVerfasst: Mi 15.03.06 19:13 
oder so
ausblenden Delphi-Quelltext
1:
Listbox1.AddItem(UserName.text,Nil);					


Gruß
Marco D.
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 2750

Windows Vista
Delphi 7, Delphi 2005 PE, PHP 4 + 5 (Notepad++), Java (Eclipse), XML, XML Schema, ABAP, ABAP OO
BeitragVerfasst: Mi 15.03.06 19:14 
user profile iconder Berliner hat folgendes geschrieben:
oder so
ausblenden Delphi-Quelltext
1:
Listbox1.AddItem(UserName,Nil);					


Gruß

Beim listbox1.add muss man weniger schreiben :D

_________________
Pascal keeps your hand tied. C gives you enough rope to hang yourself. C++ gives you enough rope to shoot yourself in the foot
counterto Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 123

Win XP
Delphi 2005 Prof., Visual Basic 2005, PHP, My Sql, Visual Basic 6
BeitragVerfasst: Do 16.03.06 09:00 
also danke erst mal,
habe jetzt alle tipps ausprobiert, aber nichts finktioniert! Ich bekomme immer eine Zgriffsverletzung!

HILFE
chrisw
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 439
Erhaltene Danke: 3

W2K
D7
BeitragVerfasst: Do 16.03.06 09:06 
Wie lautet der Fehler jetzt ?

_________________
Man sollte keine Dummheit zweimal begehen, die Auswahl ist schließlich groß genug.
Holgerwa
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 325

WIN XP Pro, Vista Business
Delphi 7 Pro, BDS 2006 Pro
BeitragVerfasst: Do 16.03.06 09:15 
Hallo,

versuchs mal so:
ausblenden Delphi-Quelltext
1:
Listbox1.Items.Add (Username.Text);					

Holger
counterto Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 123

Win XP
Delphi 2005 Prof., Visual Basic 2005, PHP, My Sql, Visual Basic 6
BeitragVerfasst: Do 16.03.06 10:23 
hi mit diesem code:

ausblenden Quelltext
1:
listbox1.Items.Add(neuereintrag.Text);					

geht es auch nicht :(,

kann es vielleicht daran liegen, das ich eine neue Form hinzugefügt hab auf der dieser Button ist, und die Listbox auf der Mainform? Damit er die Listbox anerkennt, muss ich die ja in den Variablen Teil der neuen Form schreiben?
ausblenden Quelltext
1:
2:
3:
 var
  Form3: TForm3;
  listbox1: TListbox;


oder? mach ich was falsch?

Der Fehler ist diesmal: Zugrifsverletzung: Erste Gelegenheit für Exception bei $7C81EB33. Exception-Klasse EAccessViolation mit Meldung 'Zugriffsverletzung bei Adresse 0045A7D8 in Modul 'PWSecure.exe'. Lesen von Adresse 00000260'. Prozess PWSecure.exe (1752)
counterto Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 123

Win XP
Delphi 2005 Prof., Visual Basic 2005, PHP, My Sql, Visual Basic 6
BeitragVerfasst: Do 16.03.06 10:31 
ok ich habs jetzt also des geht so:

ausblenden Quelltext
1:
form2.listbox1.items.add(neuereintrag.Text);					


aber nochmals danke für eure Hilfe!
wdbee
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 628
Erhaltene Danke: 1



BeitragVerfasst: Do 16.03.06 10:36 
Wenn die Listbox1 im From1 (Dateiname UnitForm1.pas) ist und in Form2 verwendet werden soll, dann musst du auch die Listbox1 des Form1 angeben:

in Form2:
ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
implementation

uses
  UnitForm1;

...
  Form1.Listbox1. ...
counterto Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 123

Win XP
Delphi 2005 Prof., Visual Basic 2005, PHP, My Sql, Visual Basic 6
BeitragVerfasst: Do 16.03.06 10:46 
so ok das wäre geschafft jetzt nur noch eins: ich habe jetzt 3 listboxs mit 3 verschiedenen Inhalten, diesen will ich jetzt speichern und laden:
ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
procedure TForm2.Button2Click(Sender: TObject);
begin
listbox1.Items.SaveToFile('C:\list.txt');
listbox2.Items.SaveToFile('C:\list.txt');
listbox3.Items.SaveToFile('C:\list.txt');
end;

procedure TForm2.Button3Click(Sender: TObject);
begin
listbox1.Items.LoadFromFile('C:\list.txt');
listbox2.Items.LoadFromFile('C:\list.txt');
listbox3.Items.LoadFromFile('C:\list.txt');
end;


Doch wenn ich jetzt die liste lade, läd er nur ein Inhalt der Listbox und übernimmt es auf alle 3. Gibt es da eine elegantere Lösung?

Moderiert von user profile iconTino: Code- durch Delphi-Tags ersetzt
Miri
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 657


Delphi 3 Prof., Delphi 2005 PE
BeitragVerfasst: Do 16.03.06 10:48 
ist doch klar... du schreibst ja auch nur eine datei, und überschreibst die dann zwei mal... kannst doch sonst auch nicht eine datei in drei editoren öffnen und hast drei komplett verschiedene texte drin, oder?

also? drei verschiedene dateien schreiben... für jede listbox eine...
counterto Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 123

Win XP
Delphi 2005 Prof., Visual Basic 2005, PHP, My Sql, Visual Basic 6
BeitragVerfasst: Do 16.03.06 11:13 
so ok danke des habich jetzt geändert. Gibt es eine Möglichkeit, dass der User selsbt den Pfad aussucht?
Luckie
Ehemaliges Mitglied
Erhaltene Danke: 1



BeitragVerfasst: Do 16.03.06 11:16 
Guck dir mal die Komponenten auf der Palette "Dialoge" an.

Oder:
ausblenden Delphi-Quelltext
1:
listbox1.Items.SaveToFile(Edit1.Text);					
counterto Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 123

Win XP
Delphi 2005 Prof., Visual Basic 2005, PHP, My Sql, Visual Basic 6
BeitragVerfasst: Do 16.03.06 11:19 
ok hab die benötigten Komponeten gefunden: Wie code ich das jetzt, weil ich noch nie solche Dialoge benutz habe ;)
Miri
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 657


Delphi 3 Prof., Delphi 2005 PE
BeitragVerfasst: Do 16.03.06 11:28 
hm...wie wärs erstma mit in der hilfe nachlesen, da stehts doch recht gut beschrieben, und wenns dann noch nicht geht, erstmal die forensuche quälen... Suche in der Entwickler-Ecke OPENDIALOG liefert 375 ergebnisse, da wird wohl was dabei sein...