Enter the ID number, intercept birthday, output//370303199003053330//console.write ("Please enter the ID number:"); String id = console.readline (); if (ID. Length = =)//{//String year = ID. Substring (6,4); String month = ID. Substring (10,2); String day = ID. Substring (12,2); Console.WriteLine ("Your Birthday is:" +year+ "year" +month+ "month" +day+ "Day"); }//else//{//Console.WriteLine ("Wrong input!") "); }//console.readline (); Mailbox format//1. There is only one @//2. Cannot start with @//[email protected] and. Cannot be together//[emai L protected] At least one of them. 5. Cannot end with.//console.write ("Please enter your email account:"); String mail = Console.ReadLine (); bool a = mail. Contains ("@"); if (a = = true)//{//int b = mail. IndexOf ("@"); int c = mail. LastIndexOf ("@"); if (b = = c)//{//if (b! = 0)//{// String mail1 = mail. Substring (b); if (mail1. Contains (".")) {//int d = mail1. IndexOf ("."); if (d! = 1)//{//int e = Mail1. LastIndexOf ("."); if (E! = Mail1. LENGTH-1)//{//Console.WriteLine ("email format entered correctly! "); }//else//{// Console.WriteLine ("Wrong input! "); }//}//Else//{ Console.WriteLine ("Wrong input! "); // } }//else//{//Console.WriteLine (" Wrong input! "); }//}//Else//{//CONSOLE.W Riteline ("Wrong input! "); }//}//Else//{//Console.WriteLine ("Wrong input!") "); }//}//else//{//Console.WriteLine ("Wrong input!") "); }//string s = "abcdefghijklmnopqrstuvwxyzABCDEFGHJKLMNOPQRSTUVWXYZ0123456789"; Random Number class//random ran = new random ();//Initialize//double a = ran. Next (10); int B = ran. Next (s.length); Console.WriteLine (a); Console.ReadLine (); Random out verification code, control the input, judge whether the correct//string s = "abcdefghijklmnopqrstuvwxyzABCDEFGHJKLMNOPQRSTUVWXYZ0123456789"; Random ran = newRandom (); String Biao = ""; for (int i = 1; I <= 4; i++)//{//Biao + = S.substring (ran. Next (s.length), 1); }//console.writeline (Biao); Console.Write ("Please enter the Verification Code:"); String shu = Console.ReadLine (); if (Shu. ToLower () = = Biao. ToLower ())//{//Console.WriteLine ("Input correct!") "); }//else//{//Console.WriteLine ("Input Error! "); }//console.readline (); Console.clear (); Console.WriteLine ("123"); Console.ReadLine (); string s = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789"; Random ran = new random (); for (;;) {String A = ""; for (int i = 1; I <= 4; i++) {A + = S.substring (RAN). Next (s.length), 1); } COnsole. WriteLine (a); Console.WriteLine ("Please enter the Verification Code:"); String B = Console.ReadLine (); if (b.tolower () = = A.tolower ()) {Console.WriteLine ("input correct"); Break } else {console.clear (); Console.WriteLine ("Input Error"); }} console.readline ();
Whether the length intercepted by the string class contains a number