帝国软件
  设为首页 加入收藏 关于我们
 
解密帝国网站管理系统
栏 目:
 
您的位置:首页 > 技术文档 > ASP编程
用ASP实现免费计数器提供-1
作者: 发布时间:2005-03-12 来源:
要实现免费提供计数器,我们必须准备代表0-9这10个数字的gif图片,便依次命名为0.gif-9.gif.在主页目录下建立一个目
录free,把图片文件counter.asp,user.html,reg.asp,manage.asp,dele.asp,easpcount.asp放在free目录下.  
1.存放用户数据的记数文件counter.asp  
<%Response.Write "拒绝访问!" : Response.end%>  

2.用户申请程序:user.html  

<html><title>计数器申请</title>  

<body style="background-color:#f7f7fb">  

<form name="formname" action="reg.asp" method=post >  

<p align="center" style="font-size:24pt;font-weight:bold;color:#800000">计数器申请</p>  

<table border="0" cellspacing="0" width="300" style="font-size:10pt">  

<tr><td align="left">用户名称:<input type="text" size="30" name="name"></td></tr>  

<tr><td align="left">用户密码:<input type="password" size="30" name="pass"></td></tr>  

<tr><td align="left">主页名称:<input type="text" size="30" name="homename"></td></tr>  

<tr><td align="left">主页地址:<input type="text" size="30" name="url" ></td> </tr>  

<tr><td align="left">  

<input type="submit" value="完 成">  <input type="reset" value="取 消">  

</td></tr></table></form></body>  
3.处理用户申请程序reg.asp  
<%  
Response.Expires=0  
dim input()  
name = Request.Form("name")  
pass = Request.Form("pass")  
homename = Request.Form("homename")  
url = Request.Form("url")  
infile = server.mappath("counter.asp")  
Set fs = CreateObject("Scripting.FileSystemObject")  
Set thisfile = fs.OpenTextFile(infile,1,False)  
counter = 0  
do while not thisfile.AtEndOfStream  
thisline = thisfile.readline  
Redim preserve input(counter)  
input(counter) = thisline  
counter = counter + 1  
loop  
thisfile.Close  
for i=0 to counter-1  
if name=input(i) then  
Response.write "<body bgcolor=#f7f7fb><p> <p align='center'>对不起,已有这个用户名</p>"  
Response.write "<p align='center'><a href='javascript:history.go(-1);'>点击这里进行修改</a></p></body>"  
Response.end  
exit for  
end if  
next  
Set outfile = fs.CreateTextFile(infile)  
outfile.WriteLine input(0)  
outfile.WriteLine name  
outfile.WriteLine pass  
outfile.WriteLine homename  
outfile.WriteLine url  
outfile.WriteLine 0  
for i=1 to counter-1  
outfile.WriteLine input(i)  
next  
outfile.close  
set fs=nothing  
strs="<script src=http://gp/wwwroot/free/easpcount.asp?id="&name&"></script>"  
'src中"http://gp/wwwroot/"为你的主页空间主目录  
Response.write "<body bgcolor=#f7f7fb><p> <p align='center'><font style='color:red'>"&name&"</font> 你已申
请成功,请将以下代码粘贴到你的网页代码中</p>"  
Response.write "<p align='center' style='color:#800000'>"&server.htmlencode(strs)&"</p>"  
Response.end  
%>  
---------------------------------------------------  
writen by aspboy and powered by http://easp.126.com  
  
评论】【加入收藏夹】【 】【打印】【关闭
※ 相关链接
 ·用ASP做一个记事本编缉器  (2005-03-12)
 ·用ASP发送HTML格式的邮件  (2005-03-12)
 ·如何用ASP创建日志文件  (2005-03-12)
 ·使用asp+中的若干问题及解决方案  (2005-03-12)
 ·使用ASP重启服务器  (2005-03-12)
 ·如何用ASP建立图表  (2005-03-12)
 ·如何使用asp创建dsn  (2005-03-12)
 ·如何用asp进行base64加密  (2005-03-12)
 ·用ASP创建多栏选项列表  (2005-03-12)
 ·用ASP/ADSI显示NT系统中的用户和  (2005-03-12)

   栏目导行
  PHP编程
  ASP编程
  ASP.NET编程
  JAVA编程
   站点最新
·致合作伙伴的欢迎信
·媒体报道
·帝国软件合作伙伴计划协议
·DiscuzX2.5会员整合通行证发布
·帝国CMS 7.0版本功能建议收集
·帝国网站管理系统2012年授权购买说
·PHPWind8.7会员整合通行证发布
·[官方插件]帝国CMS-访问统计插件
·[官方插件]帝国CMS-sitemap插件
·[官方插件]帝国CMS内容页评论AJAX分
   类别最新
·在ASP中使用数据库
·使用ASP脚本技术
·通过启动脚本来感受ASP的力量
·学习使用ASP对象和组件
·解析asp的脚本语言
·初看ASP-针对初学者
·ASP开发10条经验总结
·ASP之对象总结
·ASP与数据库应用(给初学者)
·关于学习ASP和编程的28个观点
 
关于帝国 | 广告服务 | 联系我们 | 程序开发 | 网站地图 | 留言板 帝国网站管理系统