When developing an ASP. NET MVC application, it is possible to require a random string, either as a password or as a verification code.
If you need a SQL version, you can refer to "password requires special characters (ii)" http://www.cnblogs.com/insus/archive/2012/02/16/2354453.html
How much of this implementation method is referred to this implementation of C # version.
Under Application, create a CharacterUtility.cs:
In this category, there are several static methods, respectively:
One, for random lowercase letters:
Two, is randomly generated capital letters:
Three, is randomly generated numbers:
Four, is to produce special characters, character sets you can define:
Each of the above attributes can be randomly obtained one character, the following insus.net write a method to get a 8-bit length of random string, of course, you can define the length:
In the control, write an action and a method to perform for jquery:
Finally, you create a view:
Live Demo: