大雀软件园

首页 软件下载 安卓市场 苹果市场 电脑游戏 安卓游戏 文章资讯 驱动下载
技术开发 网页设计 图形图象 数据库 网络媒体 网络安全 站长CLUB 操作系统 媒体动画 安卓相关
当前位置: 首页 -> 技术开发 -> ASP专区 -> ASP Function in common use

ASP Function in common use

时间: 2021-07-31 作者:daque

 ======================= ' 检验和测定上页能否从本站提交 ' 归来:true,false ' ======================= function isselfrefer() dim shttp_referer, sserver_name shttp_referer = cstr(request.servervariables("http_referer")) sserver_name = cstr(request.servervariables("server_name")) if mid(shttp_referer, 8, len(sserver_name)) = sserver_name then isselfrefer = true else isselfrefer = false end if end function '***************************** '创造文献目次 '***************************** dim fs,newpath,delpath,fpath,delfpath function fsfolder(tname) newpath=server.mappath(""&tname&"") set fs=server.createobject("scripting.filesystemobject") if fs.folderexists(newpath)=true then response.write "<script language='javascript'>"&_    "alert('有此文献夹名请从新定名');"&_    "history.go(-1);"&_  "</script>" response.end else fs.createfolder(newpath) set fs=nothing end if end function '***************************** '简略文献目次 '***************************** function delfolder(tname) delpath=server.mappath(""&tname&"") set fs=server.createobject("scripting.filesystemobject") if fs.folderexists(delpath)=true then fs.deletefolder delpath,true end if set fs=nothing end function '*************************************** '创造文献 '*************************************** function createfile(fname,strfile) dim fpath,os,fs fpath=server.mappath(""&fname&"") set fs=server.createobject("scripting.filesystemobject") set os=fs.createtextfile(fpath,true,false) os.write strfile os.close set os=nothing set fs=nothing end function '*************************************** '简略文献 '*************************************** function delfile(fname) set fs=server.createobject("scripting.filesystemobject") fname=server.mappath(fname) 'response.write fname if fs.fileexists(fname)=false then exit function else fs.deletefile fname,true end if set fs=nothing end function '***************************** '读取文献 '***************************** function readfile(fname) dim strfile,fs,os set fs=server.createobject("scripting.filesystemobject") fname=server.mappath(fname) if fs.fileexists(fname)=false then readfile="" exit function else set os=fs.opentextfile(fname,1,false,false) strfile=os.readall os.close set os=nothing 'response.write strfile readfile=strfile end if set fs=nothing end function '***------分页发端------ function urlstr(fieldname,fieldvalue) dim i if not isarray(fieldname) then exit function for i=0 to ubound(fieldname) urlstr=urlstr&"&"&cstr(fieldname(i))&"="&cstr(fieldvalue(i)) next end function function pagelist (ipagevalue,iretcount,icurrentpage,fieldname,fieldvalue) dim url dim pagecount '页总额 dim pageroot '页列表头 dim pagefoot '页列表尾 dim outstr url=urlstr(fieldname,fieldvalue) if (iretcount mod ipagevalue)=0 then pagecount= iretcount \ ipagevalue else pagecount= (iretcount \ ipagevalue)+1 end if if icurrentpage-4<=1 then pageroot=1 else pageroot=icurrentpage-4 end if if icurrentpage+4>=pagecount then  pagefoot=pagecount else pagefoot=icurrentpage+4 end if outstr="分页:"&icurrentpage&"/"&pagecount&"页 共"&iretcount&"条 " if pageroot=1 then if icurrentpage=1 then  outstr=outstr&"9" outstr=outstr&"7 " else outstr=outstr&"<a href='?page=1" outstr=outstr&url outstr=outstr&"' title=""首页"">9" outstr=outstr&"<a href='?page="&icurrentpage-1 outstr=outstr&url outstr=outstr&"' title=""上页"">7 " end if else outstr=outstr&"<a href='?page=1" outstr=outstr&url outstr=outstr&"' title=""首页"">9" outstr=outstr&"<a href='?page="&icurrentpage-1 outstr=outstr&url outstr=outstr&"' title=""上页"">7..." end if for i=pageroot to pagefoot if i=cint(icurrentpage) then outstr=outstr&"["+cstr(i)+"] " else outstr=outstr&"<a href='?page="&cstr(i) outstr=outstr&url outstr=outstr&"'>["+cstr(i)+"] " end if if i=pagecount then exit for next if pagefoot=pagecount then if cint(icurrentpage)=cint(pagecount) then  outstr=outstr&"8" outstr=outstr&":" else outstr=outstr&"<a href='?page="&icurrentpage+1 outstr=outstr&url outstr=outstr&"' title=""下页"">8" outstr=outstr&"<a href='?page="&pagecount outstr=outstr&url outstr=outstr&"' title=""尾页"">:" end if else outstr=outstr&"... <a href='?page="&icurrentpage+1 outstr=outstr&url outstr=outstr&"' title=""下页"">8" outstr=outstr&"<a href='?page="&pagecount outstr=outstr&url outstr=outstr&"' title=""尾页"">:" end if outstr=outstr&"  <input type=text class=in size=3 value="&icurrentpage&" onmouseover='this.focus();this.select()' name=pgnumber> <input type=button id=button1 name=button1 class=bot value=' go ' onclick="&""""&"if(document.all.pgnumber.value>0 && document.all.pgnumber.value<="&pagecount&"){window.location='?page='+document.all.pgnumber.value+'"&url&"'}"&""""&" onmouseover='this.focus()' onfocus='this.blur()' >" pagelist=outstr end function

热门阅览

最新排行

Copyright © 2019-2021 大雀软件园(www.daque.cn) All Rights Reserved.