<% function counter_add(file_name) dim mp,fs,fh,data1,fs1,fh2 mp=Server.MapPath(file_name) set fs=CreateObject("Scripting.FileSystemObject") Set fh=fs.OpenTextFile(mp,1,true) data1=Server.HTMLEncode(fh.ReadLine) fh.Close Application.Lock Application(file_name)=CLng(data1) Application.UnLock if Session("master")<>1215 then if Session(file_name)<>72 then Application.Lock Application(file_name)=Application(file_name)+1 Application.UnLock Session(file_name)=72 mp1=Server.MapPath(file_name) set fs1=Server.CreateObject("Scripting.FileSystemObject") Set fh2=fs1.OpenTextFile(mp1,2,true) fh2.WriteLine Application(file_name) fh2.Close end if end if counter_add=Application(file_name) end function Function G_Counts(Counter0,floder0) dim mp0,StrCounts mp0="http://www.masm.idv.tw" StrCounts = CStr(Counter0) For i = 1 to Len(StrCounts) G_Counts = G_Counts & "" Next End Function dim filen,pictn,data0,counter1 filen=Request.QueryString("file0") pictn=Request.QueryString("pic0") data0 = counter_add("/usr_data/" & filen) counter1=G_Counts(data0,pictn) %> document.write('<%=counter1 %>')