一個(gè)完成任意改變計(jì)數(shù)器位數(shù)的函數(shù)。
發(fā)表時(shí)間:2024-01-15 來源:明輝站整理相關(guān)軟件相關(guān)文章人氣:
[摘要]U2 Forum rautinee原創(chuàng)'http://u2bbs.126.com'下面的函數(shù)將實(shí)現(xiàn)任意改變計(jì)數(shù)器位數(shù),你要做的準(zhǔn)備工作是:'1、999_count.txt建立一個(gè)文本文件,并把初始值設(shè)為0。'2、準(zhǔn)備一組數(shù)字圖片放在gif目錄下Function GC...
$U2 Forum rautinee原創(chuàng)$
'$http://u2bbs.126.com$
'下面的函數(shù)將實(shí)現(xiàn)任意改變計(jì)數(shù)器位數(shù),你要做的準(zhǔn)備工作是:
'1、999_count.txt建立一個(gè)文本文件,并把初始值設(shè)為0。
'2、準(zhǔn)備一組數(shù)字圖片放在gif目錄下
Function GCounter(CounterLen)'CounterLen是計(jì)數(shù)器的位數(shù)
CountFile=Server.MapPath("999_count.txt")
Set FileObject=Server.CreateObject("Scripting.FileSystemObject")
Set Out=FileObject.OpenTextFile(CountFile,1,FALSE,FALSE)
counter=Out.ReadLine'讀取'999_count.txt里面的計(jì)數(shù)值
Out.Close
Set FileObject=Server.CreateObject("Scripting.FileSystemObject")
Set Out=FileObject.CreateTextFile(CountFile,TRUE,FALSE)
Application.lock
counter=counter+1'累計(jì)加1
Out.WriteLine(counter)
Application.unlock
Out.Close
Dim S, i, G ,n
S = CStr( counter )
if Len(s)<CounterLen then
For n = 1 to CounterLen-len(s)
G = G&"<IMG SRC=http://www.okasp.com/techinfo/gif/0.gif>"
Next
End if
For i = 1 to Len(S)
G = G & "<IMG SRC=gif/" & Mid(S, i, 1) & ".gif>"
Next
response.write G
End Function