ASP.NET 生成验证码

时间:2013-01-05 09:00:01
【文件属性】:
文件名称:ASP.NET 生成验证码
文件大小:17KB
文件格式:RAR
更新时间:2013-01-05 09:00:01
验证码 ASP.NET 生成验证码 string _strcode = "1,2,3,4,5,6,7,8,9,0,a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,y,v,w,x,y,z"; int _int_length = 4; protected void Page_Load(object sender, EventArgs e) { Response.Write(str_code()); } public string str_code() { int int_start = -1; string str_return = ""; Random r = new Random(unchecked((int)DateTime.Now.Ticks)); string[] arr_str = _strcode.Split(new char[] { ',' }); for (int i = 0; i < _int_length; i++) { int_start = r.Next(0, arr_str.Length - 1); str_return += arr_str[int_start]; } return str_return; }
【文件预览】:
验证码
----验证码()
--------WebApplication1()
--------WebApplication1.suo(13KB)
--------WebApplication1.sln(1KB)

网友评论