-
-
-
-
-
-
-
-
:
-
-






_________
.


 
ASP. .

ASP. .


ASP: IIS 5


IIS 3, 4, 5, PWS, GoAhead. - - Windows .(Chili-ASP, ActivePerl). :

Microsoft

www.activeserverpages.ru

IIS


: , . " - "


:


:

()


:

( )

C Microsoft


: , "" , asp-.

Microsoft PageCounter . ISAPI-dll ( ) / PageCounter.

PageCnt.dll \\InetPub\\ASPSamp\\Components\\PageCnt\\DLL\\i386 : regsvr32 PageCnt.dll , , .

2 HITS RESET

:
, .

<%
Set MyPageCounter = Server.CreateObject("IISSample.PageCounter")
HitMe = MyPageCounter.Hits
%>


:
.

<% =HitMe %>


:

<%
Set MyPageCount = Server.CreateObject("IISSample.PageCounter")
MyPageCount.PageHit
HitMe = MyPageCount.Hits
%> <% =HitMe %>


<% Set MyPageCounter = Server.CreateObject("IISSample.PageCounter")
%>
This Web page has been viewed <%= MyPageCount.Hits %> times.
<P>
Page Myscript.asp has been viewed
<%= MyPageCounter.Hits("/VirtualDir1/Myscript.asp") %> times.


, - (12345) :

<%
=HitMe + 12345
%>


(RESET).

<%
Set MyPageCounter = Server.CreateObject("IISSample.PageCounter")
MyPageCounter.Reset
MyPageCounter.Reset("/VirtualDir1/Mypage.asp")
%>

e


: . .

VBScript (WSH) FileSystemObject.

1. c:\\mycount.txt

2. . 0.

3. :

<%
'
Const ForReading = 1, ForWriting = 2, ForAppending = 8
Dim fso, f, myCounter
'
Set fso = CreateObject("Scripting.FileSystemObject")
' ,
' , (Trye).
Set f = fso.OpenTextFile("c:\\mycount.txt", ForReading, True)
'
On error resume next
' , (Empty)
' 0 myCounter
myCounter = f.readAll
If myCounter = Empty Then
myCounter = 0
' , myCounter 1
Else
myCounter = myCounter + 1
End If
'
Set f = fso.OpenTextFile("c:\\mycount.txt", ForWriting, True)
f.Write myCounter
'
f.Close
'
Set f = nothing
Set fso = nothing
%>

4. .

<%
= myCounter
%>


. ( ), , .

- global.asa

:

<SCRIPT LANGUAGE=VBScript RUNAT=Server>
SUB Session_OnStart
Session.Timeout = 5
Application.lock
Application("myCounter") = Application("myCounter") + 1
Application("visitors") = Application("visitors") + 1
Application.unlock
END SUB
</script>
<SCRIPT LANGUAGE=VBScript RUNAT=Server>
SUB Session_OnEnd
Application.lock
Application("visitors") = Application("visitors") - 1
Application.unlock
END SUB
</script>


asp- :

<%
Dim vist, currentcount
visit = Application("visitors")
currentcount = Application("myCounter")
%>


/

<%
= currentcount & "/" & visit
%>



: aka Udjin