asp生成不需要数据库的中奖码(10)
Dim strTmp, iYear,iMonth,iDate
iYear = Year(d)
iMonth = Month(d)
iDate = Day(d)
strTmp = CStr(iYear)
If iMonth < 10 Then
strTmp = strTmp & "0" & Cstr(iMonth)
Else
strTmp = strTmp & Cstr(iMonth)
End If
If iDate < 10 Then
strTmp = strTmp & "0" & Cstr(iDate)
Else
strTmp = strTmp & Cstr(iDate)
End If
CFTGetServerDate = strTmp
End Function
Function CFTGetServertime(d)
Dim strTmp, iYear,iMonth,iDate
iYear = hour(d)
iMonth = minute(d)
iDate = second(d)
strTmp = ""
If iYear < 10 Then
strTmp = strTmp & "0" & Cstr(iYear)
Else
strTmp = strTmp & Cstr(iYear)
End If
If iMonth < 10 Then
strTmp = strTmp & "0" & Cstr(iMonth)
Else
strTmp = strTmp & Cstr(iMonth)
End If
If iDate < 10 Then
strTmp = strTmp & "0" & Cstr(iDate)
Else
strTmp = strTmp & Cstr(iDate)
End If
CFTGetServertime = strTmp
End Function
function GetRnd(min,max)
Randomize
GetRnd = Int((max - min + 1) * Rnd + min)
end function
function getrnddatenum()
getrnddatenum = CFTGetServerDate(now) & CFTGetServertime(now) & GetRnd(1000,9999)
内容版权声明:除非注明,否则皆为本站原创文章。