|
|
|
|
µ¹¸ÍÀÌ / 2001-08-23 / ¿ÀÈÄ 1:02:49 / 203.234.144.16
Á¶È¸¼ö : 118
|
[Áú¹®] Ä«¿îÅÍ Áú¹®ÀÔ´Ï´Ù.< |
[¼¹ö¿¡ ÀÖ´Â Ä«¿îÅÍ]
<SCRIPT LANGUAGE="VBScript" RUNAT="Server">
Sub Application_OnStart
Set Application("DBConn")=Server.CreateObject("ADODB.Connection")
Application("DBConn").Open ("DSN=*****;UID=**;PWD=******")
Application("time") = now
Application("count") = 0
End Sub
Sub Session_OnStart
ipaddr = Request.ServerVariables("REMOTE_ADDR")
SQL = "INSERT INTO userCount(ssdat, ipaddress) VALUES(getdate(), '"&ipaddr&"')"
Application("DBConn").execute(SQL)
Application.Lock
Application("Count")=Application("Count")+1
Application.UnLock
End Sub
Sub Session_OnEnd
Application.Lock
Application("Count")=Application("Count")-1
Application.UnLock
End Sub
</script>
----------------------------------------------
[º»ÀÎÀÛ¼º Ä«¿îÅÍ]
<script language="VBScript" Runat="Server">
sub Application_OnStart
Set FileObject = Server.CreateObject("Scripting.FileSystemObject")
VisitCountFileName = "C:\inetpub\wwwroot\work\bycksan\test\count\visitnum\visit.txt"
SetOut = FileObject.OpenTextFile(VisitCountFileName,1,FALSE,FALSE)
Application("count")=Out.Readline
Application("VisitCountFileName") = VisitCountFileName
End sub
Sub Application_OnEnd
Set FileObject = Server.CreateObject("Scripting.FileSystemObject")
Set Out = FileObject.CreateTextFile(Application("visitCountFileName"),TRUE)
Application.Lock
Out.WriteLine(Application("count"))
Application.unlock
End sub
Sub Session_OnStart
Application.lock
Application("count") = Application("count")+1
Application.unlock
session.timeout = 20
If Application("count") MOD 10 = 0 then
Set FileObject = Server.CreateObject("Scripting.FileSystemObject")
Set Out = FileObject.CreateTextFile(Application("visitCountFileName"),TRUE)
Application.lock
out.writeLine(Application("count"))
out.close
Application.unlock
End if
End Sub
Sub Session_OnEnd
End Sub
</script>
-----------------------------------------------
ÇöÀç ȸ»çȨÆäÀÌÁöÄ«¿îÅÍ´Â "host : "www.*****" is not in the auth block of the conf file"
À» °¡¸£Å°°í Àֳ׿ä.
´ã´çÀÚ ¸»·Î´Â ´Ù¸¥ °÷¿¡ ¸µÅ©°É¾ú´Âµ¥ Áö¿øÀÌ ¾ÈµÈ´Ù
°í Çؼ ´Ù½Ã ¸¸µé¾î º¸¾Ò½À´Ï´Ù....
º»ÀÎÀÌ ¸¸µç ÀÌ Ä«¿îÅ͸¦ ´Ù½Ã ¼¹ö¿¡´Ù Áý¾î³Ö°í
visit.txt¸¸µé¾î¼ Áý¾î³ÖÀ¸¸é µÇ³ª¿ä.
Àú °³ÀÎÀûÀ¸·Î´Â [¼¹ö¿¡ ÀÖ´Â Ä«¿îÅÍ]´Â ±¦ÂúÀº °Í
°°Àº µ¥¿ä...
¹æ½Ä Á» °¡¸£ÃÄ ÁÖ¼¼¿ä... |
|
|
|