Another method of the counter: automatic switch home picture

zhaozj2021-02-16  92

Visitors see are the same picture every time, is it a bit single? Let visitors see different pictures every time? It is very simple to use counter! The source program is as follows:

<% '----------------------------------------------- --------- Counting program Start DIM FileObject, Countfile, Out, Counter, Picno, PPSet fileObject = Server.createObject ("scripting.filesystemObject") Countfile = Server.MAppath ("count.txt") 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 counter = counter 1 '------------------------------------------------------------------------------------------------------------------------------------------------------------------ ---------------- Counting program End if counter> 99 Then counter = 0 'can't exceed a value, you pay attention to you, you can't follow the digital variables displayed :( If counter <10 Then 'I have only 10 pictures now, 10 below is' how much PICNO = CounterelsePICNO = (counter MOD 10)' is greater than 10 only one bit, because I have only 10 pictures: (End ifout. WriteLine (counter) 'puts the current count value inside Application.unlock Out.close%>

The method of the deposited value used in this example is to access the text file.

display image

<% response.write ("")%>

转载请注明原文地址:https://www.9cbs.com/read-11669.html

New Post(0)