首 页 网络编程
网页制作 图形图象 操作系统 冲浪宝典
软件教学 认证考试

网络安全 网络办公 行业资讯 评测对比
您当前位置:站长天空 -> 操作系统-> Windows xp教程
ASP Function in common use 1-ASP教程,ASP应用
作者:网友供稿 点击:17
推荐
西部数码-全国虚拟主机10强!20余项虚拟主机管理功能,全国领先!第6代双线路虚拟主机,南北访问畅通无阻!可在线rar解压,自动数据恢复设置虚拟目录等.免费赠送访问统计,企业邮局.Cn域名注册10元/年,自助建站480元起,免费试用7天,满意再付款!P4主机租用799元/月.月付免压金
站内搜索
文章页数:[1] 
=======================
检测上页是否从本站提交
返回: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

文章整理:站长天空 网址:http://www.z6688.com/
以上信息与文章正文是不可分割的一部分,如果您要转载本文章,请保留以上信息,谢谢!

文章页数:[1] 


放大字体显示 缩小字体显示 打印文章 推荐给朋友
热门文章
·用ghost完美克隆windows xp+sp2
·[ASP.NET]如何在客户端调用服务端代码-.NET教程,Asp.Net开发
·安装windows sp2后 程序为何不能运行
·windows xp系统虚拟内存的标准设置方法
·SQL Server端口更改后的数据库连接方式-ASP教程,数据库相关
·Java学生成绩管理系统源代码-JSP教程,Java技巧及代码
·精华的微软文章".NET 数据访问架构指南"-.NET教程,数据库应用
·系统高手 xp最新应用技巧六招
·windows xp操作系统疑难问题巧解决
·SQL Server 调用C#。net写的Dll ,(分享我的HelloWorld测验)-.NET教程,C#语言
最新文章
·谈谈三年来做站的经验_站长心得
·用户的体验习惯化与去习惯化_站长心得
·web2.0网站需要借鉴的七种传统赢利模式_站长心得
·网页布局的位置重心与位置间的对比关系_站长心得
·google adsense公益广告的替代方法_google推广
·google adsense全面解析_google推广
·2006年关于google等的15项预测_google推广
·google搜索技巧_google推广
·有趣的网上搜索_google推广
·网站制作简易流程介绍_站长心得
相关主题
  • ASP Forum2.0学习笔记之二---了解Master Pages库-ASP教程,数据库相关
  • 西部数码虚拟主机

    友情链接
    CNNIC 西部数码
    万网 自助建站
    虚拟主机 asp空间
    域名注册 域名
    域名申请 主页空间
    论坛空间 网站空间
    国际域名 虚拟空间
    空间租用 DDOS防火墙
    成都主机托管 四川主机托管
    主机租用 服务器租用
    网站目录 自助建站
    虚拟主机 网址大全
    软件下载
    自助链接
    虚拟主机资讯 特价虚拟主机
    版权申明:本站文章均来自网络,如有侵权,请联系我们,我们收到后立即删除,谢谢!
    关于我们:站长天空:专业提供最新的站长资讯、在线教程、虚拟主机权威评测、虚拟主机性能对比、网站制作教程,开发教程,站长工具。包括网页制作教程、冲浪宝典、编程参考、操作系统、软件教学、行业动态等。
    特别注意:本站所有转载文章言论不代表本站观点,本站所提供的摄影照片,插画,设计作品,如需使用,请与原作者联系,版权归原作者所有。
    发表评论 打印  刷新     关闭