html使用vb脚本点击计数器 [英] html hit counter using vb script

查看:97
本文介绍了html使用vb脚本点击计数器的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

嗨我有一个在我们服务器上托管的网站的点击计数器。我每次网站点击时都使用vb脚本写入文本文件。它是使用iis托管的本地网站。问题是,当从服务器的浏览器打开网站时,它只将匹配写入文本文件。如果网站在另一台计算机上打开,它不会写入文本文件的命中。我已将iis权限授予共享驱动器上的文本文件。



hi i have a hit counter for a website hosted on our server. i am using vb script to write to text file each time the website has a hit. it is a local website hosted using iis. the problem is that it only writes the hits to the textfile when the website is opened from the server''s brower. if the website is opened on another computer, it does not write hits to the text file. I have granted iis permissions to the text file which is on a shared drive.

<font color="#FFFFFF"><b>Total Site Hits:</b>
<SCRIPT type=text/vbscript>
Dim fso
Dim tso
Dim filObject
Dim VisitorCount
Dim strOutputName
Dim objOutputFile
Set fso = CreateObject("Scripting.FileSystemObject")
Set filObject = fso.GetFile("\\cci-opsweb01\TTHitCount\HitCounter.txt")
Set tso = filObject.OpenAsTextStream
VisitorCount = CLng(tso.ReadAll)
VisitorCount = VisitorCount + 1
strOutputName = "\\cci-opsweb01\TTHitCount\HitCounter.txt"
Set objOutputFile = fso.createTextFile(strOutputName,True)
objOutputFile.WriteLine VisitorCount
Document.Write(VisitorCount)
</Script>

推荐答案

引用:

在网站打开时将匹配写入文本文件服务器的浏览器。如果网站在另一台计算机上打开,它不会写入文本文件

writes the hits to the textfile when the website is opened from the server''s brower. if the website is opened on another computer, it does not write hits to the text file



那是因为你写的是


That is because you are writing to

引用:

\\cci-opsweb01 \TTHitCount \HitCounter.txt

"\\cci-opsweb01\TTHitCount\HitCounter.txt"

存在于服务器上而不是客户端打开浏览器的机器上代码被执行。请记住,脚本是在使用您的URL打开浏览器的机器上执行的。



如果您希望在服务器上更新点击计数器,则需要将点击发布到服务器。



http://helpingdotnet.blogspot.com/2011/10/page-hit-counter-using-application-in.html [ ^ ]

http://magwebonline.blogspot.com/2013/01/ create-page-hit-counter-in-aspnet.html [ ^ ]

HTTP://www.codingasp。 net / 2011/09 / unique-visiter-counter-in-aspnet.html [ ^ ]

http ://highoncoding.com/Articles/78_Implementing_Hit_Counter_in_Asp_net.aspx [ ^ ]





或者更确切地说使用互联网上提供的免费点击计数器。例如www.statcounter.com

which exists on the server and not on the client''s machine where the browser is opened and the code is executed. Remeber that the script is executed on the machine where the browser is opened with your URL.

If you want the hit counter to be updated on the server, you need to post the ''hit'' to the server.

http://helpingdotnet.blogspot.com/2011/10/page-hit-counter-using-application-in.html[^]
http://magwebonline.blogspot.com/2013/01/create-page-hit-counter-in-aspnet.html[^]
http://www.codingasp.net/2011/09/unique-visiter-counter-in-aspnet.html[^]
http://highoncoding.com/Articles/78_Implementing_Hit_Counter_in_Asp_net.aspx[^]


Or rather use the free hit counters available on the internet . e.g www.statcounter.com


如果你想找出没有页面命中,你可以简单地使用日志解析器,它可以免费下载,然后写入csv文件。阅读以下文章:



http://www.sanjeevnandam.com/blog/extract-information-from-an-iis-log [ ^ ]



http://mlichtenberg.wordpress.com/2011/02/03/log-parser-rocks - 超过50个例子/ [ ^ ]



谢谢

Sameera
If you want to find out the no of page hits, you can simply use log parser which can be downloaded free and then written to a csv file. Read the articles below:

http://www.sanjeevnandam.com/blog/extract-information-from-an-iis-log[^]

http://mlichtenberg.wordpress.com/2011/02/03/log-parser-rocks-more-than-50-examples/[^]

Thanks
Sameera


这是一个html网站。从服务器的Internet Explorer
it is a html website. it works when the website is opened from the server''s internet explorer

这篇关于html使用vb脚本点击计数器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆