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.Windows.Forms; 9 10 namespace _12 11 { 12 public partial class Form1 : Form 13 { 14 public Form1() 15 { 16 InitializeComponent(); 17 a.ForeColor = Color.Red; 18 b.ForeColor = Color.Red; 19 mm.PasswordChar = '*'; 20 21 } 22 23 private void label5_Click(object sender, EventArgs e) 24 { 25 26 } 27 28 private void button1_Click(object sender, EventArgs e) 29 { 30 ts.Text = ""; 31 a.Hide(); 32 b.Hide(); 33 string z = "123"; 34 string m = "123"; 35 zh.Text = zh.Text.Trim(); 36 mm.Text = mm.Text.Trim(); 37 if (zh.Text == "") 38 { 39 a.Show(); 40 return; 41 } 42 if (mm.Text == "") 43 { 44 b.Show(); 45 return; 46 } 47 ts.Text =(zh.Text == z && mm.Text == m) ? "正确":"错误"; 48 ts.ForeColor =(zh.Text == z && mm.Text == m) ?Color.Green:Color.Red; 49 50 51 } 52 53 private void label3_Click(object sender, EventArgs e) 54 { 55 56 } 57 58 private void Form1_Load(object sender, EventArgs e) 59 { 60 61 } 62 } 63 }
标签:zh,登录,mm,Text,void,系统,System,using From: https://www.cnblogs.com/liujiaxing-/p/18262361