|
|
|
|
俵ÀÌ / 2001-08-29 / ¿ÀÈÄ 6:15:42 / 203.255.3.190
Á¶È¸¼ö : 140
|
[Áú¹®] Ä«¿îÆÿ¡·¯ÀÔ´Ï´Ù.
|
> [main.asp]
> <tr> <font size="-1" color="BROWN">¹æ¹®ÀÚ ¼ö
> <%
> count = application("count")
>
> for i=1 to Len(count)
> select case Mid(count,i,1)
>
> case "1"
> response.write "<img src = 'image\1.jpg' align='middle'>"
> case "2"
> response.write "<img src = '\image\2.jpg' align='middle'>"
> case "3"
> response.write "<img src = '\image\3.jpg' align='middle'>"
> case "4"
> response.write "<img src = '\image\4.jpg' align='middle'>"
> case "5"
> response.write "<img src = '\image\5.jpg' align='middle'>"
> case "6"
> response.write "<img src = '\image\6.jpg' align='middle'>"
> case "7"
> response.write "<img src = '\image\7.jpg' align='middle'>"
> case "8"
> response.write "<img src = '\image\8.jpg' align='middle'>"
> case "9"
> response.write "<img src = '\image\9.jpg' align='middle'>"
> case "0"
> response.write "<img src = '\image\0.jpg' align='middle'>"
>
> end select
> next
> %> ¹ø° ÀÔ´Ï´Ù.
>
>
> [global.asa]
> <script language="VBScript" Runat="Server">
>
> sub Application_OnStart
>
> Set Application("DBConn")=Server.CreateObject("ADODB.Connection")
> Application("DBConn").Open ("DSN=*****;UID=****;PWD=*****")
>
> Set FileObject = Server.CreateObject("Scripting.FileSystemObject")
> VisitCountFileName = "C:\visitnum\visit.txt"
>
>
> Application("VisitCountFileName") = VisitCountFileName
> Application("time") = now
> Application("count") = 10000
>
>
> 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
>
> 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
>
> session.timeout = 20
>
> If Application("count") MOD 10 = 0 then
> Set FileObject = Server.CreateObject("Scripting.FileSystemObject")
>
>
> Application.lock
>
> out.writeLine(Application("count"))
>
> out.close
> Application.unlock
> End if
>
> End Sub
>
> Sub Session_OnEnd
>
> End Sub
>
>
> Sub Session_OnEnd
> Application.Lock
> Application("Count")=Application("Count")-1
> Application.UnLock
> End Sub
> </script>
>
>
> Ä«¿îÅÍ´Â ½ÃÀ۵Ǿú½À´Ï´Ù.
> ±×·±µ¥¿ä. ÇÑÂü Ä«¿îÆÃÇÏ´Ù°¡ ¿¹)10100 --> 10084·Î
> ¹Ù²î³×¿ä.
> Á¦°¡ º¸±â¿¡ ¿¡·¯°¡ º¸ÀÌÁú ¾Ê¾Æ¼¿ä.
> ¿ì¿Õ ÈÄ¿¡ ÀÌ »ç½ÇÀ» ¾Ë¾Ò´Âµ¥ ¿Ö ±×·±Áö Á» °¡¸£ÃÄ
> ÁÖ¼¼¿ä....
>
-----------------------------------------------------------
Èì... ´ëÃæ ºÃÀ»¶§ ¼Ò½º»ó¿¡ ¿©·¯ ¹®Á¦°¡ º¸À̴µ¥¿ä...
ÀÏ´Ü ¹æ¹®ÀÚÀÇ Ä«¿îÆ®¼ö´Â ÆÄÀÏ·Î ¼¼°í ¹æ¹®ÀÚÀÇ Á¤º¸´Â DB¿¡´Ù Áý¾î ³Ö°í ÀÖ´Â°Í °°³×¿ä...
DB¸¦ »ç¿ëÇÒ°Å¸é ¾Æ¿¹ ÆÄÀÏÀ» »ç¿ëÇÏÁö ¾Ê°í ±×³É DB·ÎºÎÅÍ SELECT¸¦ ÇÏ¸é µÇÁö ¾Ê³ª¿ä?
±»ÀÌ ¹æ¹®ÀÚÀÇ ¼ö¸¦ ÆÄÀÏ¿¡ ±â·ÏÇÒ ÇÊ¿ä°¡ ¾ø°ÚÁÒ...
±× ´ÙÀ½¿¡ Applicaiotn_OnStart¿¡¼¿ä
Application("count") = 10000
À̶ó´Â ¹®ÀåÀÌ º¸À̴±º¿ä... ÀÌ·¸°Ô µÇ¸é ÄÄÀ» Ä×´Ù ²¬¶§¸¶´Ù
Ä«¿îÆ®°¡ 10000À¸·Î ÃʱâÈ µÉÅÙµ¥....
±×·¸Áö ¾Ê³ª¿ä? Èì....
±×¸®°í Ä«¿îÆ®ÀÇ ¼ýÀÚ°¡ ³»·Á°¡´Â ÀÌÀ¯´Â
Session_OnEnd¿¡¼ ¿Ö Application("count")¿¡¼ »©±â¸¦ ÇϽôÂÁö¿ä?
±×·¸°Ô µÇ¸é ´ç¿¬È÷ Application("count")ÀÇ ¼ýÀÚ°¡ ³»·Á°¥ °Å°í...
±×·³ ȸ鿡´Â Ä«¿îÆ®ÀÇ ¼ýÀÚ°¡ ÁÙ°ÚÁö¿ä...
Session_OnEnd°¡ 2°³³ª Àֳ׿ä.... Èì...
|
|
|
|