1 using System; 2 using System.Collections.Generic; 3 using System.ComponentModel; 4 using System.Data; 5 using System.Drawing; 6 using System.Linq; 7 using System.Text; 8 using System.Threading.Tasks; 9 using System.Windows.Forms; 10 using zhuce; 11 using zhuchuangti; 12 13 14 15 namespace moshou 16 { 17 public partial class Form1 : Form 18 { 19 public Form1() 20 { 21 InitializeComponent(); 22 } 23 24 public void login_Click(object sender, EventArgs e) 25 { 26 if (emailaddress.Text.Trim() == "" || password.Text.Trim() == "") 27 { 28 MessageBox.Show("用户名或密码不为空!", "提示"); 29 } 30 else if (emailaddress.Text == Frmregist.name && password.Text == Frmregist.pwd) 31 { 32 33 Frmmain fm = new Frmmain(); 34 fm.Show(); 35 this.Hide(); 36 } 37 else 38 { 39 MessageBox.Show("用户名或密码错误!", "提示"); 40 } 41 } 42 43 44 45 private void label4_Click(object sender, EventArgs e) 46 { 47 Frmregist fr = new Frmregist(); 48 49 fr.Show(); 50 this.Hide(); 51 } 52 53 private void pictureBox1_Click(object sender, EventArgs e) 54 { 55 56 } 57 58 59 } 60 }
1 using System; 2 using System.Collections.Generic; 3 using System.ComponentModel; 4 using System.Data; 5 using System.Drawing; 6 using System.Linq; 7 using System.Text; 8 using System.Threading.Tasks; 9 using System.Windows.Forms; 10 using moshou; 11 12 namespace zhuce 13 { 14 public partial class Frmregist : Form 15 { 16 public static string name; 17 public static string pwd; 18 public static string name2; 19 public Frmregist() 20 { 21 InitializeComponent(); 22 } 23 24 25 public void button1_Click(object sender, EventArgs e) 26 { 27 if (txtb3.Text == txtb5.Text && txtb4.Text == txtb6.Text && txtb3.Text != "" && txtb4.Text != "" && txtb5.Text != "" && txtb6.Text != "") 28 { 29 name = txtb3.Text; 30 pwd = txtb4.Text; 31 name2 = txtb1.Text; 32 MessageBox.Show("注册成功!"); 33 login fm = new login(); 34 fm.Show(); 35 this.Hide(); 36 } 37 else 38 { 39 MessageBox.Show("注册失败"); 40 } 41 } 42 43 private void button2_Click(object sender, EventArgs e) 44 { 45 46 } 47 48 private void Frmregist_Load(object sender, EventArgs e) 49 { 50 Frmregist fr = new Frmregist(); 51 52 fr.Show(); 53 this.Hide(); 54 } 55 56 private void pictureBox1_Click(object sender, EventArgs e) 57 { 58 59 } 60 } 61 }
1 using System; 2 using System.Collections.Generic; 3 using System.ComponentModel; 4 using System.Data; 5 using System.Drawing; 6 using System.Linq; 7 using System.Text; 8 using System.Threading.Tasks; 9 using System.Windows.Forms; 10 using moshou; 11 using zhuce; 12 13 namespace zhuchuangti 14 { 15 public partial class Frmmain : Form 16 { 17 public Frmmain() 18 { 19 InitializeComponent(); 20 } 21 22 //public FrmLogin f1; 23 //private void FrnMain_Load(object sender, EventArgs e) 24 //{ 25 // label1.Text = Frmregist.name2; 26 //} 27 28 private void Frmmain_Load(object sender, EventArgs e) 29 { 30 31 } 32 } 33 }
1 using System; 2 using System.Collections.Generic; 3 using System.Linq; 4 using System.Text; 5 6 namespace moshou 7 { 8 class login 9 { 10 internal void Show() 11 { 12 throw new NotImplementedException(); 13 } 14 } 15 }
using System; using System.Collections.Generic; using System.Linq; using System.Threading.Tasks; using System.Windows.Forms; namespace moshou { static class Program { /// <summary> /// 应用程序的主入口点。 /// </summary> [STAThread] static void Main() { Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); Application.Run(new Form1()); } } }
//最后跳转到的页面