日期:2018-1-1 浏览次数:602次

1、
<%  
Function getRandStr(ByVal len)
Dim str
Randomize '加上这段
For i=1 to len
str = str & Mid("0123456789ABCDEF", Int(16*Rnd+1), 1)
Next
getRandStr = str
End Function
 
Response.Write getRandStr(32)
 
 
2、
    '根据时间生成唯一ID标识
 Function getUIIDno() '格式:YYYYMMDD HHMMSS
yy=year(date)
mm=right("00"&month(date),2)
dd=right("00"&day(date),2)
'生成号所有所需元素,格式为:小时,分钟,秒
xiaoshi=right("00"&hour(time),2)
fenzhong=right("00"&minute(time),2)
miao=right("00"&second(time),2)
getUIIDno=yy&mm&dd&xiaoshi&fenzhong&miao
End Function
 
3、UUID
 Dim objTypeLib  
Set objTypeLib = CreateObject("Scriptlet.TypeLib")  
    strSignatureNonce=replace(objTypeLib.Guid,"{","") ' getUIIDno() '生成时间唯一的号
    strSignatureNonce=replace(strSignatureNonce,"}","")