usingSystem;usingSystem.Collections.Generic;usingSystem.Linq;usingSystem.Text;usingSystem.Threading.Tasks;namespaceVerification Code string procedure {classProgram {Static voidMain (string[] args) { //define a set of strings string[] s=New string[ +] {"0","1","2","3","4","5","6","7","8","9", "a","b","C","D","e","F","g","h","I","J","k","L","m","N","o","P","Q","R","s", "T","u","v","W","x","y","Z", "A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q", "R","S","T","U","V","W","X","Y","Z" }; stringA="";//defines a character variable with a value of NULLRandom ran =NewRandom (); for(inti =0; I <4; i++ ) { intSuijishu = ran. Next (0, +); A+ = S[suijishu];//Four randomly generated characters are linked to a string representing the verification code} Console.WriteLine ("Verification Code:"+a); stringb = A.toupper ();//background execution converts all the resulting strings to uppercaseConsole.Write ("Please enter the verification code:"); stringR =Console.ReadLine (); stringQ = R.toupper ();//converts a user-entered string all to uppercase if(q = =b) {Console.WriteLine ("Verify Success! "); } Else{Console.WriteLine ("input Error! "); } console.readline (); } }}
C # Verification code