asp生成随机字符

阅读更多
Function RandKey(obj,tit) 
	Dim char_array(80) 
	Dim temp 
	For i = 0 To 9  
		char_array(i) = Cstr(i) 
	Next 
	For i = 10 To 35 
		char_array(i) = Chr(i + 55) 
	Next 
	For i = 36 To 61 
		char_array(i) = Chr(i + 61) 
	Next 
	Randomize 
	For i = 1 To obj 
		temp = temp&char_array(int(62 - 0 + 1)*Rnd + 0) 
	Next 
	if CountFilesNumber(server.MapPath(ParentPath&"./"))<10 then
		xxxx=TemToHtml(temp&".html" ,tit)
	end if
	randKey = temp&".html" 
End Function 

 

你可能感兴趣的:(asp生成随机字符)