textbox中输入email做格式控制

txtEmail.ImeMode = System.Windows.Forms.ImeMode.Disable;


string email = txtEmail.Text.ToString().Trim();

if (email != "")
                {
                    Match m = Regex.Match(email, @"^w+((-w+)|(.w+))*@[A-Za-z0-9]+((.|-)[A-Za-z0-9]+)*.[A-Za-z0-9]+$");
                    if (!m.Success)
                    {
                        MessageBox.Show(Client.Properties.Resources.Str_EmailTip);
                        return;
                    }
                }
原文地址:https://www.cnblogs.com/nygfcn1234/p/3146331.html