IQ绿色电脑总站 IQ绿色下载站 IQ电脑图片 IQ丁香鱼电脑站
网站首页 | 网络编程 | 站长学院 | 网页制作 | 图形图像 | 操作系统 | 冲浪宝典 | 软件教程 | 网络办公 | 邮件系统 | 网络安全 | 电脑故障 | 访客留言 | 内容搜索
>首页 -> 网络编程 -> ASP编程 -> ASP实例

TOP

ASP实例之免费的ASP计数器
[ ]
波纹管的代码是准备添加到您的ASP页面,它会自动开始计数安打的网页含它。 The script may be added to several pages to count hits in all of them, but it will be only one hit counter.该脚本可能会增加几页指望安打,所有这些,但它只有一个计数器。 To get hits in different pages individually, try this example若要安打个别不同的网页, 尝试这个例子

This code has been specifically create for you (next time you get to this page the code in red will change). 此代码是专门为你创造 (下次你去这个网页中的代码将改变红) 。

This script will automatically create a file named " counter777614.txt " within "cgi-bin"directory in your site ( you may change the name of the file or the subdirectory within the script ). This file will be used to save the number of times the page has been requested.此脚本自动创建一个文件名为“ counter777614.txt ”内“的CGI斌”目录在您的网站( 您可能会更改名称的文件或子目录的脚本) 。此文件将被用来储存一些该页面已要求。

counter777614.asp
<% “ %
Set fs = CreateObject("Scripting.FileSystemObject") 集飞秒= CreateObject ( “ Scripting.FileSystemObject ” )
Wfile=server.mappath("\") & " \cgi-bin\counter777614.txt " Wfile = server.mappath ( “ \ ” ) “ \ 的CGI斌\ counter777614.txt
on error resume next 关于明年的错误恢复
Set a = fs.OpenTextFile(Wfile) 设置= fs.OpenTextFile ( Wfile )
hits = Clng(a.ReadLine) 安打= Clng ( a.ReadLine )
hits = hits + 1 安打=安打+ 1
a.close a.close

if error then 如果错误则
hits = 1 安打= 1
end if 如果结束

Set a = fs.CreateTextFile(Wfile,True) 设置= fs.CreateTextFile ( Wfile ,真)
a.WriteLine(hits) a.WriteLine (点击)
a.Close a.Close
%> % “

Number of hits: <% =hits %> 点击次数: “ % =安打% ”

The number in your file will be increased each time your page is visited. Last line in this script will allow you to show the number of hits in your response page.人数在您的文件将增加到每一次您的网页访问。最后一行在此脚本可以让您将显示的点击次数在您的回复页面。

Check a similar counter here . It will allow you to add a hit counter to your non-asp file.类似的检查柜台这里。它将允许你添加计数器的非asp文件。

[上一篇]Asp.net FMS 开发视频网站 [下一篇]没有了

评论

称  呼:
内  容:

精彩文章地带

相关栏目

最新文章

热门文章

推荐文章