Common ASP user-defined function set (S. Sams)

Source: Internet
Author: User
Tags chr
Source: viewpoint design 8see.net
Http://blog.8see.net/
Rem --- form prompt function Being -----------------------------
CODE Copy...
Function Check_submit (str, restr)
If str = "" then
Response. write "<script>"
Response. write "alert ('" & restr &"');"
Response. write "history. go (-1 )"
Response. write "</script>"
Response. end
Else
Check_submit = str
End if
End Function
CODE Copy...
Function Alert_submit (str)
Response. write "<script>"
Response. write "alert ('" & str &"');"
'Response. write "location. reload ();"
Response. write "</script>"
End Function
CODE Copy...
Function localhost_submit (str, urls)
Response. write "<script>"
If str <> "" then
Response. write "alert ('" & str &"');"
End if
Response. write "location = '" & urls &"';"
Response. write "</script>"
End Function
Rem --- generate a custom random number Being -----------------------------
CODE Copy...
Function makerndid (byVal maxLen)
Dim strNewPass
Dim whatsNext, upper, lower, intCounter
RANdomize
For intCounter = 1 To maxLen
WhatsNext = int (2 * Rnd)
If whatsNext = 0 Then
Upper = 80
Lower = 70
Else
Upper = 48
Lower = 39
End If
StrNewPass = strNewPass & Chr (Int (upper-lower + 1) * Rnd + upper ))
Next
Makerndid = strNewPass
End Function
Rem --- generate four-digit random number Being -----------------------------
CODE Copy...
Function get_rand ()
Dim num1
Dim rndnum
Randomize
Do While Len (rndnum) <4
Num1 = CStr (Chr (57-48) * rnd + 48 ))
Rndnum = rndnum & num1
Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.