您的位置:首页 > 其它

生成4位随机验证码

2006-02-18 15:49 302 查看
//@ 2006 flyasm
Random newRandom=new Random();
txtRandom.Text="";
string tempRandom="";
for(int i=0;i<4;i++)
{
string t=Convert.ToInt16(9*a.NextDouble()).ToString();
code.Text+="<img src='images/random/"+t+".gif'>";
tempRandom+=t;
txtRandom.Text=tempRandom;
}
Session.Add("code",tempRandom);
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: