用正则表达式,这个很简单的 Console.WriteLine("请输入");string url = Console.ReadLine();bool b = Regex.IsMatch(url, "^[a-zA-Z0-9]+@sina.com$"); Console.WriteLine(b);