代码改变世界

3. 输入Email地址,输出用户名和域名。

2012-10-09 10:47  飞鸟爱巢  阅读(514)  评论(0编辑  收藏  举报

private void button1_Click(object sender, EventArgs e)        

{             string email = textBox1.Text;            

string[] strs =email.Split('@');            

if (strs.Length!=2)            

{                

MessageBox.Show("输入不合法");                

return;            

}            

textBox2.Text = strs[0];            

textBox3.Text = strs[1];

        }