最新下载
热门教程
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
asp开发中常用函数
时间:2011-04-06 编辑:简简单单 来源:一聚教程网
asp教程开发中常用函数
sub lastnextpage(pagecount,page,table_style,font_style)
'生成上一页下一页链接
dim query, a, x, temp
action = "http://" & request.servervariables("http_host") & request.servervariables("script_name")
query = split(request.servervariables("query_string"), "&")
for each x in query
a = split(x, "=")
if strcomp(a(0), "page", vbtextcompare) <> 0 then
temp = temp & a(0) & "=" & a(1) & "&"
end if
next
response.write("
end sub
sub chkfod(fstring)
if trim(fstring) <> empty then
if right(fstring, 1) <> "/" then
fstring = fstring & "/"
end if
dim i, tempdir
fstring = split(fstring, "/")
for i = 1 to ubound(fstring)
if trim(fstring(i)) <> empty then
tempdir = tempdir & "/" & fstring(i)
set fso = createobject("scripting.filesystemobject")
if fso.folderexists(server.mappath(tempdir)) = false then
fso.createfolder (server.mappath(tempdir))
end if
set fso = nothing
else
exit for
end if
next
end if
end sub
rem 设置随机数字
function cdstr(dlen)
'response.write cdstr(9) ''指定长度为9的随机字符串
dim ss,sslen
randomize timer
ss="1234567890"
sslen = len(ss)
cdstr = ""
for i = 1 to dlen
t = cint(rnd*sslen)+1 ''这里加1,不然出现mid(ss,0,1)会出错
cdstr = cdstr&mid(ss,t,1)
next
end function
'检查字符串长度
function strlength(str)
on error resume next
dim winnt_chinese
winnt_chinese = (len("论坛")=2)
if winnt_chinese then
dim l,t,c
dim i
l=len(str)
t=l
for i=1 to l
c=asc(mid(str,i,1))
if c<0 then c=c+65536
if c>255 then
t=t+1
end if
next
strlength=t
else
strlength=len(str)
end if
if err.number<>0 then err.clear
end function
-
上一个: asp 格式化时间日期
-
下一个: asp 生成验证码实例代码
相关文章
- asp入门函数语法速查手册 12-22
- asp防cc攻击函数 11-04
- asp开发中常用函数 11-30
- asp replace 替换内容函数 02-22
- asp安全检测函数 05-16
- asp之数学函数 01-18