关于htm代码?

关于htm代码?,第1张

1.把以下代码存为一个名为imgcounter.asp的文件

<% @language="VBScript"%>

<%

dim images(20)

dim imageszero

CountFile=Server.MapPath("counter.txt")

Set FileObject=Server.CreateObject("Scripting.FileSystemObject")

Set Out=FileObject.OpenTextFile(CountFile,1,FALSE,FALSE)

counter=Out.ReadLine

Out.Close

SET FileObject=Server.CreateObject("Scripting.FileSystemObject")

Set Out=FileObject.CreateTextFile(CountFile,TRUE,FALSE)

Application.lock

if session("counter")<>"pass" then

counter= counter + 1

session("counter")="pass"

else

counter=counter+0

end if

Out.WriteLine(counter)

Application.unlock

countlen=len(counter)

for i=1 to 8-countlen

imageszero="<img src="&"number/"&"/" &"0.gif></img>"

response.write"document.write('"&imageszero&"')"

next

for i=1 to countlen

images(i)="<img src="&"number/"&"/" &mid(counter,i,1) &".gif></img>"

response.write"document.write('"&images(i)&"')"

next

Out.Close

%>

2.在与imgcounter.asp文件同根目录下建一个counter.txt的文件.在里头写入一个数字,刚开始应该是

0

3.与2一样,创建一个文件number,在这个文件里头放十点

GIF图片,图片上分别显示一到九.

3.在需要显示计数器的地方插入以下代码:

你是本站第

<script language="JavaScript" src="imgcounter.asp">

</script>

个访问者

这样你的网站可以统计被访问过多少次,而且是以漂亮的

图片显示出来.统计出来的数据是存放在文件中的,不会丢失.

1、拖一个“变电站管理.htm的网页”快捷到桌面;

2、在hosts中建立一个指向。

.htm本身就可以用浏览器打开(双击时,自动就在ie中打开了)。

hosts本来是很简单得事,但你一点概念没有,就不是一句两句说得清得了。


欢迎分享,转载请注明来源:内存溢出

原文地址:https://54852.com/yw/7950460.html

(0)
打赏 微信扫一扫微信扫一扫 支付宝扫一扫支付宝扫一扫
上一篇 2023-04-11
下一篇2023-04-11

发表评论

登录后才能评论

评论列表(0条)

    保存