按以上布局, 分析1事件: int atindex = textBox1.Text.IndexOf("@"); if (atindex == -1) { MessageBox.Show("非法"); return; } textBox2.Text = textBox1.Text.Substring(0, atindex); textBox3.Text = textBox1.Text.Substring(atindex + 1); 分析2: string[] emailstring = textBox1.Text.Split('@'); if (emailstring.Length < 2) { MessageBox.Show("非法"); return; } textBox2.Text = emailstring[0]; textBox3.Text = emailstring[1];