C # written a simple landing interface dialog for the original code

xiaoxiao2021-03-06  63

A summary description of Namespace aa1 {///

/// Form1. /// public class Form1: System.Windows.Forms.Form {private System.Windows.Forms.Label label1; private System.Windows.Forms.Label label2; private System.Windows.Forms.Label label3; private System.Windows.Forms.TextBox textBox1; private System.Windows.Forms.TextBox textBox2; private System.Windows.Forms.Button button1; private System.Windows.Forms.Button button2; /// /// required Designer variable. /// private system.componentmodel.container component = null; public string name, ID;

Public Form1 () {// // Windows Form Designer Support for // InitializationComponent (); {Name = NULL; ID = NULL;} // // Todo: Add any constructor code after INITIALIZEComponent call / /}

///

/// Clean all the resources being used. /// Protected Override Void Dispose (Bool Disposing) {if (disponents! = Null) {components.dispose ();}} Base.Dispose

#Region Windows Form Designer Generated Code ///

/// Designer Supports the required method - Do not use the code editor to modify the // / this method.

/// private (this.label1 = new system.windows.forms.label (); this.label2 = new system.windows.forms.label (); this.label3 = new system. Windows.Forms.Label (); this.textBox1 = new System.Windows.Forms.TextBox (); this.textBox2 = new System.Windows.Forms.TextBox (); this.button1 = new System.Windows.Forms.Button (); This.Button2 = new system.windows.Forms.Button (); this.suspendlayout (); // // label1 // this.label1.location = new system.drawing.point (128, 24); this .label1.name = "label1"; this.label1.size = new system.drawing.size (168, 16); this.label1.tabindex = 0; this.Label1.text = "Please enter your username and password"; // // label2 // this.label2.location = new system.drawing.point (56, 80); this.label2.name = "label2"; this.label2.size = new system.drawing.size (56, 16); this.label2.tabindex = 1; this.label2.text = "user name"; /// Label3 // this.label3.Location = new system.drawing.point (56, 120); this.label3 .Nam E = "label3"; this.label3.size = new system.drawing.size (48, 16); this.label3.tabindex = 2; this.label3.text = "password"; /// textbox1 ///////// TextBox1 // This.TextBox1.Location = new system.drawing.point (136, 72); this.textbox1.name = "textbox1"; this.textBox1.size = new system.drawing.size (112, 21); this.TextBox1. Tabindex = 3; this.TextBox1.text = ""; /// textbox2 // this.textBox2.Location = new system.drawing.point (136, 112); this.textbox2.name = "textbox2"; this. TextBox2.size = new system.drawing.size (112, 21);

THISTBOX2.TABINDEX = 4; this.TextBox2.text = ""; /// Button1 // this.button1.Location = new system.drawing.point (288, 72); this.button1.name = "Button1 "; This.button1.size = new system.drawing.size (64, 24); this.button1.tabindex = 5; this.button1.text =" ok "; this.button1.click = new system.eventhandler This.button1_click; // // Button2 // this.button2.location = new system.drawing.point (288, 112); this.button2.name = "button2"; this.button2.size = new system.drawing .Size (64, 24); this.button2.tabindex = 6; this.button2.text = "can"; this.button2.click = new system.eventhandler (this.button2_click); // // Form1 // This.autoscalebasesize = new system.drawing.size (6, 14); this.clientsize = new system.drawing.size (392, 218); this.controls.addrange (new system.windows.forms.control [] {this .button2, this.button1, this.textbox2, this.textbox1, THIS.LABEL3, THIS.Label2, this.Label1}; this.name = "form1"; this.text = "login"; this.ResumeLayout (false);} #ENDREGION

///

/// The primary entry point of the application. /// [stathread] static void main () {Application.run (new form1 ());}

private void button1_Click (object sender, System.EventArgs e) {if (textBox1.Text == "yxq" && textBox2.Text == "1016") {MessageBox.Show ( "Good it's sucsess to login!");} else {MessageBox.show ("please try to login!");}} Private void button2_click (object sender, system.eventargs e) {dispose ();}}}

转载请注明原文地址:https://www.9cbs.com/read-111316.html

New Post(0)