当前位置: 网学 > 编程文档 > ASP > 正文

再发几个ASP不错的函数

来源:Http://myeducs.cn 联系QQ:点击这里给我发消息 作者: 用户投稿 来源: 网络 发布时间: 13/06/16
gPageCount <= lngCurPage + 5 Then
k = lngPageCount
Else
k = lngCurPage + 5
End If
Response.Write("<a href=""?" & strQueryString & "&p=" & 1 & """>" & "<<" & "</a> ")
For i = j To lngCurPage - 1
Response.Write("<a href=""?" & strQueryString & "&p=" & i & """>" & i & "</a> ")
Next
Response.Write(lngCurPage & " ")
For i = lngCurPage + 1 To k
Response.Write("<a href=""?" & strQueryString & "&p=" & i & """>" & i & "</a> ")
Next
Response.Write(" <a href=""?" & strQueryString & "&p=" & lPageCount & """>" & ">>" & "</a>")
End If
End Sub
''********************
''函数作用:当前页请求方式是否为POST
''说明:用于在同一页面处理显示和数据操作,当PostBack()为真时说明提交表单至当前页,应进行数据后台操作
Function PostBack()
If UCase(Trim(Request.ServerVariables("REQUEST_METHOD"))) = "POST" Then
PostBack = True
Else
PostBack = False
End If
End Function
''********************
''函数作用:返回执行长度的随机字符串
''参数:Length:长度
Function GenRadomString(Length)
dim i, tempS, v
dim c(39)
tempS = ""
c(1) = "a": c(2) = "b": c(3) = "c": c(4) = "d": c(5) = "e": c(6) = "f": c(7) = "g"
c(8) = "h": c(9) = "i": c(10) = "j": c(11) = "k": c(12) = "l": c(13) = "m": c(14) = "n"
c(15) = "o": c(16) = "p": c(17) = "q": c(18) = "r": c(19) = "s": c(20) = "t": c(21) = "u"
c(22) = "v": c(23) = "w": c(24) = "x": c(25) = "y": c(26) = "z": c(27) = "1": c(28) = "2"
c(29) = "3": c(30) = "4": c(31) = "5": c(32) = "6": c(33) = "7": c(34) = "8": c(35) = "9"
If isNumeric(Length) = False Then
Response.Write "A numeric datatype was not submitted to this function."
Exit Function
End If
For i = 1 to Length
Randomize
v = Int((35 * Rnd) + 1)
tempS = tempS & c(v)
Next
GenRadomString = tempS
End Function

网学推荐

免费论文

原创论文

浏览:
设为首页 | 加入收藏 | 论文首页 | 论文专题 | 设计下载 | 网学软件 | 论文模板 | 论文资源 | 程序设计 | 关于网学 | 站内搜索 | 网学留言 | 友情链接 | 资料中心
版权所有 QQ:3710167 邮箱:3710167@qq.com 网学网 [Myeducs.cn] 您电脑的分辨率是 像素
Copyright 2008-2015 myeducs.Cn www.myeducs.Cn All Rights Reserved
湘ICP备09003080号