Variablen und Strings speichern???



  • ch will mein einenes Adressbuch skripten mit Passwort, (endlich) mit VC++ 2008 express edition.
    Und ich wollte fragen wie ich ein Fenster gestallte in dem man einen neues Konto anlegen kann, sich einlogen kann und wenn man sein PW vergessen hat eine beim regestrieren gestellte frage beantworten muss dann öffnet sich ein Fensten mit dem PW...

    ...beim ersten mal öffnen des Progs soll manb sich nur registrieren können

    Ich habe es schon geschaft ein Fenster zu erstellen in dem man PW und Name eingeben kann:

    #pragma once
    
    namespace julian {
    
    	using namespace System;
    	using namespace System::ComponentModel;
    	using namespace System::Collections;
    	using namespace System::Windows::Forms;
    	using namespace System::Text;
    	using namespace System::Drawing;
    
    	/// <summary>
    	/// Zusammenfassung für Form1
    	///
    	/// Warnung: Wenn Sie den Namen dieser Klasse ändern, müssen Sie auch
    	///          die Ressourcendateiname-Eigenschaft für das Tool zur Kompilierung verwalteter Ressourcen ändern,
    	///          das allen RESX-Dateien zugewiesen ist, von denen diese Klasse abhängt.
    	///          Anderenfalls können die Designer nicht korrekt mit den lokalisierten Ressourcen
    	///          arbeiten, die diesem Formular zugewiesen sind.
    	/// </summary>
    	public ref class Form1 : public System::Windows::Forms::Form
    	{
    	public:
    		Form1(void)
    		{
    			InitializeComponent();
    			//
    			//TODO: Konstruktorcode hier hinzufügen.
    			//
    		}
    
    	protected:
    		/// <summary>
    		/// Verwendete Ressourcen bereinigen.
    		/// </summary>
    		~Form1()
    		{
    			if (components)
    			{
    				delete components;
    			}
    		}
       private: System::Windows::Forms::TextBox^  textBox1;
       protected: 
       private: System::Windows::Forms::Panel^  panel1;
       private: System::Windows::Forms::Label^  label2;
       private: System::Windows::Forms::Label^  label1;
       private: System::Windows::Forms::Button^  btn_Anmelden;
       private: System::Windows::Forms::TextBox^  tb_Kennwort;
       private: System::Windows::Forms::TextBox^  tb_Name;
    
    	private:
    		/// <summary>
    		/// Erforderliche Designervariable.
    		/// </summary>
    		System::ComponentModel::Container ^components;
    
    #pragma region Windows Form Designer generated code
    		/// <summary>
    		/// Erforderliche Methode für die Designerunterstützung.
    		/// Der Inhalt der Methode darf nicht mit dem Code-Editor geändert werden.
    		/// </summary>
    		void InitializeComponent(void)
    		{
    			System::ComponentModel::ComponentResourceManager^  resources = (gcnew System::ComponentModel::ComponentResourceManager(Form1::typeid));
    			this->textBox1 = (gcnew System::Windows::Forms::TextBox());
    			this->panel1 = (gcnew System::Windows::Forms::Panel());
    			this->btn_Anmelden = (gcnew System::Windows::Forms::Button());
    			this->tb_Kennwort = (gcnew System::Windows::Forms::TextBox());
    			this->tb_Name = (gcnew System::Windows::Forms::TextBox());
    			this->label2 = (gcnew System::Windows::Forms::Label());
    			this->label1 = (gcnew System::Windows::Forms::Label());
    			this->panel1->SuspendLayout();
    			this->SuspendLayout();
    			// 
    			// textBox1
    			// 
    			this->textBox1->AccessibleDescription = nullptr;
    			this->textBox1->AccessibleName = nullptr;
    			resources->ApplyResources(this->textBox1, L"textBox1");
    			this->textBox1->BackgroundImage = nullptr;
    			this->textBox1->Name = L"textBox1";
    			this->textBox1->ReadOnly = true;
    			this->textBox1->TabStop = false;
    			// 
    			// panel1
    			// 
    			this->panel1->AccessibleDescription = nullptr;
    			this->panel1->AccessibleName = nullptr;
    			resources->ApplyResources(this->panel1, L"panel1");
    			this->panel1->BackgroundImage = nullptr;
    			this->panel1->Controls->Add(this->btn_Anmelden);
    			this->panel1->Controls->Add(this->tb_Kennwort);
    			this->panel1->Controls->Add(this->tb_Name);
    			this->panel1->Controls->Add(this->label2);
    			this->panel1->Controls->Add(this->label1);
    			this->panel1->Font = nullptr;
    			this->panel1->Name = L"panel1";
    			// 
    			// btn_Anmelden
    			// 
    			this->btn_Anmelden->AccessibleDescription = nullptr;
    			this->btn_Anmelden->AccessibleName = nullptr;
    			resources->ApplyResources(this->btn_Anmelden, L"btn_Anmelden");
    			this->btn_Anmelden->BackgroundImage = nullptr;
    			this->btn_Anmelden->Font = nullptr;
    			this->btn_Anmelden->Name = L"btn_Anmelden";
    			this->btn_Anmelden->UseVisualStyleBackColor = true;
    			this->btn_Anmelden->Click += gcnew System::EventHandler(this, &Form1::btn_Anmelden_Click);
    			// 
    			// tb_Kennwort
    			// 
    			this->tb_Kennwort->AccessibleDescription = nullptr;
    			this->tb_Kennwort->AccessibleName = nullptr;
    			resources->ApplyResources(this->tb_Kennwort, L"tb_Kennwort");
    			this->tb_Kennwort->BackgroundImage = nullptr;
    			this->tb_Kennwort->Name = L"tb_Kennwort";
    			// 
    			// tb_Name
    			// 
    			this->tb_Name->AccessibleDescription = nullptr;
    			this->tb_Name->AccessibleName = nullptr;
    			resources->ApplyResources(this->tb_Name, L"tb_Name");
    			this->tb_Name->BackgroundImage = nullptr;
    			this->tb_Name->Name = L"tb_Name";
    			// 
    			// label2
    			// 
    			this->label2->AccessibleDescription = nullptr;
    			this->label2->AccessibleName = nullptr;
    			resources->ApplyResources(this->label2, L"label2");
    			this->label2->Name = L"label2";
    			// 
    			// label1
    			// 
    			this->label1->AccessibleDescription = nullptr;
    			this->label1->AccessibleName = nullptr;
    			resources->ApplyResources(this->label1, L"label1");
    			this->label1->Name = L"label1";
    			// 
    			// Form1
    			// 
    			this->AccessibleDescription = nullptr;
    			this->AccessibleName = nullptr;
    			resources->ApplyResources(this, L"$this");
    			this->AutoScaleMode = System::Windows::Forms::AutoScaleMode::Font;
    			this->BackgroundImage = nullptr;
    			this->Controls->Add(this->panel1);
    			this->Controls->Add(this->textBox1);
    			this->Font = nullptr;
    			this->FormBorderStyle = System::Windows::Forms::FormBorderStyle::FixedSingle;
    			this->Icon = nullptr;
    			this->Name = L"Form1";
    			this->panel1->ResumeLayout(false);
    			this->panel1->PerformLayout();
    			this->ResumeLayout(false);
    			this->PerformLayout();
    
    		}
    #pragma endregion
       private: 
          void btn_Anmelden_Click(Object^  sender, EventArgs^  e) 
          {
             if (tb_Name->Text == "" || tb_Kennwort->Text == "")
             {
                MessageBox::Show("Falscher Benutzername oder falsches Passwort", "Fehler");
    	    SystemSounds::Beep->Play();
             }
             else if ()//Benutzername und PW richtig
             //Schwachsin  :arrow_right: 
             {
                StringBuilder ^str = gcnew StringBuilder("");
                str->Append(" Sie wurden ausspioniert. \n");
                str->Append("\n  Ihr Benutzername ist " + tb_Name->Text);
                str->Append("\n  Ihr Kennwort lautet  " + tb_Kennwort->Text);
    
                MessageBox::Show(str->ToString(), "Pech gehabt!");
             }
          }
    
    };
    }
    

    fehlen noch "Passwort vergessen?" und "neues Konto",
    wenn ma schon einmal hier sind die daten soll man nicht öffnen können ohne PW (Adressen und Passwort "speicher Datei")

    lg
    LehrLehrling (Julian -> deshalb oben "using namespace julian")



  • Dieser Thread wurde von Moderator/in Martin Richter aus dem Forum MFC (Visual C++) in das Forum C++/CLI mit .NET verschoben.

    Im Zweifelsfall bitte auch folgende Hinweise beachten:
    C/C++ Forum :: FAQ - Sonstiges :: Wohin mit meiner Frage?

    Dieses Posting wurde automatisch erzeugt.



  • Ich habs schon geschafft aber danke


Anmelden zum Antworten