Topic Requirements:
The key code looks like this:
Class program
{
static void Main (string[] args)
{
Console.WriteLine ("Please enter the correct email address to @sina. com end");
String US =convert.tostring (Console.ReadLine ());
String str1 = us. Replace ("@", "");
int count = us. Length-str1. Length;
String str2 = us. Replace (".", "");
int count2 = us. Length-str2. Length;
int count3 = us. Length-1;
int Xl=us. IndexOf (".") -us. IndexOf ("@");
bool MW = (US. IndexOf ("@sina. com") = = (US. Length-9));
while (count = = 1 && count2 = 1 && us. IndexOf ("@") > 0 && us. IndexOf (".") > us. IndexOf ("@")
&& us. IndexOf (".") <count3)
{
if (XL!= 1 && us. Contains ("@sina. com") && MW)
{
Console.WriteLine ("correct");
}
else {
Console.WriteLine ("Entered a wrong mailbox address");
}
break;
Console.ReadLine ();
}
The above mentioned is small set to introduce C # to judge email address is legitimate, I hope to help you, if you have any questions please give me a message, small set will promptly reply to everyone. Here also thank you very much for the cloud Habitat Community website support!