首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > .NET > C# >

C#关于Random()函数的使用困惑解决办法

2012-01-03 
C#关于Random()函数的使用困惑比如:for(intii 10i++){}[解决办法]看看我的随机验证码,看看对你有无启发

C#关于Random()函数的使用困惑
比如:
for(int   i;i <10;i++)
{

}

[解决办法]
看看我的随机验证码,看看对你有无启发:
public static string YanZhengMa(byte Length)
{
System.Random rand=new Random();
string result= " ";
for (int i=0;i <Length;i++)
{
result+=rand.Next(3);
}
return result;
}
使用:

x3=db.YanZhengMa(2);
this.Labelysxs.Text= " <font color=#ff3300> 服务器繁忙,请稍等: "+x3.ToString()+ " 秒! </font> ";
顺便帮忙考虑下我的问题,帮顶一下!!!
http://community.csdn.net/Expert/topic/5293/5293251.xml?temp=.8407251

热点排行