用ASP完成免費(fèi)計(jì)數(shù)器提供-1
發(fā)表時(shí)間:2024-01-03 來(lái)源:明輝站整理相關(guān)軟件相關(guān)文章人氣:
[摘要]要實(shí)現(xiàn)免費(fèi)提供計(jì)數(shù)器,我們必須準(zhǔn)備代表0-9這10個(gè)數(shù)字的gif圖片,便依次命名為0.gif-9.gif.在主頁(yè)目錄下建立一個(gè)目 錄free,把圖片文件counter.asp,user.html,reg.asp,manage.asp,dele.asp,easpcount.asp放在free目錄下....
要實(shí)現(xiàn)免費(fèi)提供計(jì)數(shù)器,我們必須準(zhǔn)備代表0-9這10個(gè)數(shù)字的gif圖片,便依次命名為0.gif-9.gif.在主頁(yè)目錄下建立一個(gè)目
錄free,把圖片文件counter.asp,user.html,reg.asp,manage.asp,dele.asp,easpcount.asp放在free目錄下.
1.存放用戶數(shù)據(jù)的記數(shù)文件counter.asp
<%Response.Write "拒絕訪問(wèn)!" : Response.end%>
2.用戶申請(qǐng)程序:user.html
<html><title>計(jì)數(shù)器申請(qǐng)</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">計(jì)數(shù)器申請(qǐng)</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">主頁(yè)名稱:<input type="text" size="30" name="homename"></td></tr>
<tr><td align="left">主頁(yè)地址:<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.處理用戶申請(qǐng)程序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'>對(duì)不起,已有這個(gè)用戶名</p>"
Response.write "<p align='center'><a href='
javascript:history.go(-1);'>點(diǎn)擊這里進(jìn)行修改</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/"為你的主頁(yè)空間主目錄
Response.write "<body bgcolor=#f7f7fb><p> <p align='center'><font style='color:red'>"&name&"</font> 你已申
請(qǐng)成功,請(qǐng)將以下代碼粘貼到你的網(wǎng)頁(yè)代碼中</p>"
Response.write "<p align='center' style='color:#800000'>"&server.htmlencode(strs)&"</p>"
Response.end
%>
---------------------------------------------------
(出處:熱點(diǎn)網(wǎng)絡(luò))