Ich erstelle eine Anwendung, die grundlegende Datenbankverbindungsinformationen wie Host, Benutzer, Passwort und Standarddatenbankname in den Anwendungseinstellungen mit Benutzerbereich speichern.kann nicht speichern Anwendung Einstellungen in. NET 3.5
Ich verwende .net 3.5 mit Visual Studio 2008
habe ich 4 Textfelder in einem Benutzersteuer und band ihre Text-Eigenschaft auf die Anwendungseinstellungen individuelle Eigenschaften.
//
// textBox_database
//
this.textBox_database.Location = new System.Drawing.Point(103, 101);
this.textBox_database.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4);
this.textBox_database.Name = "textBox_database";
this.textBox_database.Size = new System.Drawing.Size(255, 27);
this.textBox_database.TabIndex = 5;
this.textBox_database.Text = global::PHP_Code_Generator_2.Properties.Settings.Default.mysql_database;
//
// textBox_password
//
this.textBox_password.Location = new System.Drawing.Point(103, 69);
this.textBox_password.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4);
this.textBox_password.Name = "textBox_password";
this.textBox_password.Size = new System.Drawing.Size(255, 27);
this.textBox_password.TabIndex = 4;
this.textBox_password.Text = global::PHP_Code_Generator_2.Properties.Settings.Default.mysql_password;
this.textBox_password.UseSystemPasswordChar = true;
//
// textBox_user
//
this.textBox_user.Location = new System.Drawing.Point(103, 37);
this.textBox_user.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4);
this.textBox_user.Name = "textBox_user";
this.textBox_user.Size = new System.Drawing.Size(255, 27);
this.textBox_user.TabIndex = 7;
this.textBox_user.Text = global::PHP_Code_Generator_2.Properties.Settings.Default.mysql_user;
//
// textBox_server
//
this.textBox_server.Location = new System.Drawing.Point(103, 5);
this.textBox_server.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4);
this.textBox_server.Name = "textBox_server";
this.textBox_server.Size = new System.Drawing.Size(255, 27);
this.textBox_server.TabIndex = 6;
this.textBox_server.Text = global::PHP_Code_Generator_2.Properties.Settings.Default.mysql_server;
Diese Textfelder erhalten Benutzerdaten von Benutzern, um ihre eigenen Datenbankinformationen festzulegen. Ich habe eine Schaltfläche, die die geänderten Informationen zurück in die Einstellungsdatei
speichert, aber das Design wird nicht gespeichert. Irgendwelche Hilfe irgendjemand?
Grüßen, Anjan
Cyril: Ja ich den Code hatte in ihren Eigenschaften modifiziert Wert zuweisen, dann aber auch der Umfang von „Benutzer“ gesagt wurde eingestellt Read-only. Also habe ich die Eigentumszuweisungscodes entfernt. jetzt habe ich den code zurückgebracht und VS neu gestartet, es funktioniert jetzt einwandfrei: D doof ich, ich hätte dieses alte verfahren vorher probieren sollen. Danke Cyril.