C#代码
<%@ Page Language=C# %>
<%
// 随机密码开始
ArrayList MyArray = new ArrayList()
Random random = new Random()
string str = null;
//循环的次数
int Nums = ;
while (Nums > )
{
int i = randomNext( )
// if (!MyArrayContains(i))
// {
if (MyArrayCount < )
{
MyArrayAdd(i)
}
// }
Nums = ;
}
for (int j = ; j <= MyArrayCount ; j++)
{
str += MyArray[j]ToString()
}
// 随机密码结束
ResponseWrite(str + my array count > + MyArrayCount)
%>
<%@ Page Language=C# %>
<%
// 随机密码开始
ArrayList MyArray = new ArrayList()
Random random = new Random()
string str = null;
//循环的次数
int Nums = ;
while (Nums > )
{
int i = randomNext( )
// if (!MyArrayContains(i))
// {
if (MyArrayCount < )
{
MyArrayAdd(i)
}
// }
Nums = ;
}
for (int j = ; j <= MyArrayCount ; j++)
{
str += MyArray[j]ToString()
}
// 随机密码结束
ResponseWrite(str + my array count > + MyArrayCount)
%>
asp的位随机数字的代码
Asp代码
<%
随机密码开始
Randomize
FreeMember=Int(( * Rnd) + ) 方法
Function makePassword(maxLen) 方法生成的随机码包含字母
Dim strNewPass
Dim whatsNext upper lower intCounter
Randomize
For intCounter = To maxLen
whatsNext = Int(( + ) * Rnd + )
If whatsNext = Then
character
upper =
lower =
Else
upper =
lower =
End If
strNewPass = strNewPass & Chr(Int((upper lower + ) * Rnd + lower))
Next
makePassword = strNewPass
End Function
FreeMember = makePassword()
随机密码结束
FreeMember = int((+)*RND+)方法
ResponseWrite FreeMember & my array count > &len(FreeMember)
%>