ACTIVE SERVER PAGE > Á¢¼Ó Åë°è ±¸Çϱ⠵î·ÏÀÏ : 2017-07-04 18:28 Á¶È¸¼ö : 52,6646.7.1. global.asa º¸±â. ¾È³çÇϼ¼¿ä !!! ¿À´ÃÀº °£´ÜÇÑ Á¢¼ÓÅë°è¸¦ ±¸ÇöÇÏ´Â ¹æ¹ý¿¡ ´ëÇؼ ¸îÀÚ Àû¾î º¼¶ó°í µé¾î¿Ô´ä´Ï´Ù.. ¿À´ÃÀº Áñ°Å¿î Åä¿çÀε¥,,,,, ´Ù´ú ¹¹Çϼ¼¿ä??? Àú¿ä?? ^^;; Àü Á¶±Ý ÀÖ´Ù°¡,,, ±¤ÁÖ °¡¿ä,,,,,, ¾Ø ¸¸³ª·¯,,, ·ê·ç¶ó,,, ·ê·ç¶ó,,, ºÎ·´ÁÒ??? ¸ðµÎ´ú Á¸ »ç¶÷ ¸¸³¯¼ö ÀÖÀ»°Ì´Ï´Ù.. ¸ø»ý±ä ÁöµÎ ¾ØÀÌ Àִµ¥,,,,,, ^^; ¸ÕÀú ¾îÄÉ Çϸé Á¢¼Ó Åë°è¸¦ ±¸ÇÒ ¼ö ÀÖÀ»±î???? ¹¹,,, ¿©·¯ºÐµµ ¾Ë°í ÀÖÀ¸¸®¶õ »ý°¢À» Çϱ¸ °£´ÜÇÏ°Ô ¼³¸íÀ» µå¸±²²¿ä.. 1. ¸ÕÀú ¼Õ´ÔÀÌ Á¢¼ÓÇϸé???? ¿À´ÃÀÇ ¿¬µµ¿Í, ¿ù, ½Ã°£,,, µîµîÀ» µðºñ¿¡ ÀúÀåÇÏ°Ô µË´Ï´Ù. ´ç±ÙÀÌÁÒ??? 2. ±×¸®±¸, Ãâ·ÂÇØ ÁÖ¸é µÇ°ÚÁÒ??? 3. Á¢¼ÓÀÚ°¡ ºüÁ®³ª°£´Ù.... ÇÏÇÏÇÏ~~~ ³Ê¹« ½¬¿î°¡¿ä??? ¸ðµç ÇÁ·Î±×·¥À» ³Ê¹« ¾î·Æ°Ô¸¸ »ý°¢ÇÏÁö ¸¶¼¼¿ä.. Àú°°ÀÌ °¡²ûÀº ¸ÛûÇÏ°Ô »ý°¢ÇØ¾ß ÇÁ·Î±×·¥ÀÌ Àß µÇ´Â °æ¿ìµµ Àְŵ¢¿ä,,,,,, ^^;; ±×·³, 1¹øÀÇ °æ¿ì,,, ¾îÄÉ Ã³¸®¸¦ ÇÏ¸é µÉ±î¿ä???? Á¢¼ÓÀ» Çß´Ù???? ±×·³,,, ´ç±Ù global.asp ÀÇ Sub Session_OnStart°¡ ½ÇÇàÀÌ µÇ°ÚÁÒ? ¿©±â¿¡¼ µðºñ¿¡ ¿¬°áÇÏ°í ¿¬µµ ¿ù ½Ã°£ µîµîÀ»,,,,, ÀúÀåÇÏ¸é µÉ°Ì´Ï´Ù.. Àú °°Àº °æ¿ì´Â IPÁÖ¼Ò ±î¡ ÀúÀåÀÌ µÈ´ä´Ï´Ù. ±×·³, °£´ÜÇÏ°Ô global.asa ºÎºÐÀ» º¸µµ·Ï ÇÏÁö¿ä,,, sub Session_OnStart ºÎºÐ¸¸ º¸µµ·Ï ÇÏ°Ú½À´Ï´Ù.... //-------------------------------------------------------------------------- Sub Session_OnStart Application.lock Set db = Server.CreateObject("ADODB.Connection") db.Open ("dsn=polcomm;uid=sa;pwd=;database=ankyu") SQL = "Select Max(num) from Statusbar" Set rs = Server.CreateObject("ADODB.Recordset") rs.Open SQL, db If IsNULL(rs(0)) Then number = 1 else number = rs(0) + 1 End If aaa=day(now) if Len(aaa)=1 then aaa= "0"&aaa end if SQL = "INSERT INTO Statusbar (num,year1,month1,day1,time1,ip_addr) VALUES " SQL = SQL & "( "& number SQL = SQL & ",'" & year(now) & "'" SQL = SQL & ",'" & month(now) & "'" SQL = SQL & ",'" & aaa & "'" SQL = SQL & ",'" & hour(now) & "'" SQL = SQL & ",'" & Request.ServerVariables("REMOTE_HOST") & "')" db.Execute SQL rs.Close db.close Set rs = Nothing Set db = Nothing Application.unlock End Sub //-------------------------------------------------------------------------- Á¶±Ý ±æÁÒ,,,,, ´ëÃæ ¼³¸íÀ» µå¸®ÀÚ¸é¿ä,,,, ÀúÀÇ µðºñ À̸§Àº(ankyu) ¶ø´Ï´Ù... ¿¬°áÀÌ µÆÁÒ? ±×¸®±¸ num Çʵ忡 ¹øÈ£¸¦ Ãß°¡ÇØ Áá´ä´Ï´Ù.... ±×¸®±¸ ¿À´ÃÀÇ ³¯Â¥ (day(now))¸¦ »Ì¾Æ¿Ô¾î¿ä,, ³¯Â¥°¡ 1ÀÚ¸®¸é 01,02,03,,, ÀÌ·±½ÄÀ¸·Î Ãâ·ÂÇϱâ À§Çؼ ¾Õ¿¡ "0"À» ´õÇØ Áᱸ¿ä,,, Å×À̺í À̸§Àº Statusbar ¶ø´Ï´Ù...... num : ¹øÈ£ year1 : ³âµµ month1 : ¿ù day1 : ÀÏ time1: ÇöÀç½Ã°£ ip_addr : Á¢¼ÓÀÚ ÁÖ¼Ò ÀÌ·¸°Ô µÇ¾î ÀÖ´ä´Ï´Ù.... ÀÌ·¸°Ô ÀúÀ常 Çϸé,,, µÇ°ÚÁÒ???? ¹®Á¦´Â Ãâ·ÂÀ» ½Ãų ¶§ ¾îÄÉ Ãâ·ÂÀÌ µÇ¾î¾ß Çϴ°¡??? ¹Ù·Î ¿ì¸®´Â ¿©±â¸¦ °í¹ÎÇØ¾ß ÇÒ °ÍÀÔ´Ï´Ù.... ^^;; 6.7.2. Statusbar.asp. ÀÌÁ¦ »ç¶÷µéÀÌ Á¢¼ÓÀ» ÇÏ¸é µðºñ¿¡ Á¢¼ÓÀÚµéÀÇ Á¤º¸°¡ ½×ÀÌ°Ô µÇ°ÚÁÒ?? Â÷°î Â÷°î,,, ±×·³, ÀÌÁ¨ Statusbar.asp¸¦ º¸µµ·Ï ÇÏ°Ú½À´Ï´Ù.... ÀÌ ÆÄÀÏÀº Á¢¼ÓÀÚ ÇöȲÀ» Ãâ·ÂÇØ ÁÖ´Â ÆÄÀÏÀ̶ø´Ï´Ù. ¸ÕÀú ¼Ò½º ÀÔ´Ï´Ù. //----------------------------------------------------------------- year1=request("year1") month2=request("month2") if year1="" then year1=year(now) end if if month2="" then month2=month(now) end if set db = Server.CreateObject("ADODB.Connection") db.Open ("dsn=polcomm;uid=sa;pwd=;database=ankyu) SQL = "SELECT day1,cnt=count(day1) FROM statusbar where year1='"& year1 &"' and month1='" & month2 & "' group by day1 order by day1" 'response.write sql Set rs = Server.CreateObject("ADODB.Recordset") rs.Open SQL,db,1 //----------------------------------------------------------------- ¸ÕÀú request("year1") , request("month2") °¡ ÀÖ½À´Ï´Ù.... ÀÌ °ªÀº ÇöÀçÀÇ ¿¬µµ¿Í ÇöÀçÀÇ ¿ùÀ» ¹Þ¾Æ ¿É´Ï´Ù.... ±×·¡¼ µðºñ¿Í ºñ±³¸¦ Çؾ߰ÚÁö¿ä?? ¸¸¾à °ªÀÌ ³Ñ¾î¿ÀÁö ¾Ê¾Ò´Ù¸é ÇöÀçÀÇ ³â°ú ÇöÀç ¿ùÀ» ÀúÀåÇØ¾ß µË´Ï´Ù..... ¾Æ·¡ ÁÙ¿¡ ÀÖ´Â ºÎºÐÀÌ ±× ºÎºÐÀÔ´Ï´Ù... ±×¸®±¸ Ãâ·ÂÀ» Çؾ߰ÚÁö¿ä?? Äõ¸®¹®À» º¸µµ·Ï ÇÏÁö¿ä,,,, ÇöÀç µ¥ÀÌÅÍ º£À̽º¿¡´Â ´ÙÀ½°ú °°Àº ÇüÅ·ΠÀúÀåÀÌ µÇ¾î ÀÖÀ» °Ì´Ï´Ù. ¹øÈ£ ³â ¿ù ÀÏ ½Ã°£ IP --------------------------------------- 1 2000 7 01 03 210.181.135.202 2 2000 7 01 04 xxx.xxx.xxx.xxx : --------------------------------------- ¾î¶² Äõ¸®¸¦ ½á¾ß ÇÒ±î¿ä,,,, ¸¸¾à 7¿ù¿¡ ´ëÇÑ Á¢¼ÓÅë°è¸¦ º¸°í ½Í´Ù¸é ?? SELECT * FROM statusbar where year1='2000' and month1='7' ÀÌ·¸°Ô Çϸé 7¿ù¿¡ ´ëÇÑ µ¥ÀÌÅÍ µéÀ» Ãâ·ÂÇÒ ¼ö ÀÖ°ÚÁÒ? ±×·¯³ª, ¿ì¸° ÀÌ·±½ÄÀ¸·Î Ãâ·ÂÇϱ⸦ ¿øÇÏÁö ¾Ê½À´Ï´Ù. ±×·³ ¾î¶»°Ô??? 7¿ù 1ÀÏ 500¸í 7¿ù 2ÀÏ 345¸í : ÀÌ·±½ÄÀ¸·Î Ãâ·ÂÇؾ߰ÚÁö¿ä?? ±×·³,,,, group by ¹®À» ¾²¸é °£´ÜÈ÷ 󸮸¦ ÇÒ ¼ö ÀÖ´ä´Ï´Ù. SELECT day1,cnt=count(day1) FROM statusbar where year1='"& year1 &"' and month1='" & month2 & "' group by day1 order by day1 ÀÌ·¸°Ô¿ä,,, °£´ÜÇÑ ¼³¸íÀ» µå¸®ÀÚ¸é,,,, statusbar¿¡¼ Á¶°ÇÀÌ ³Ñ°Ü ¹ÞÀº ¿¬µµ¿Í ¿ùÀÌ ÀÖ°ÚÁÒ??? ÇöÀç ¿ù¿¡ ÇØ´çÇÏ´Â ¸ðµç »ç¿ëÀÚµéÀ» Ãâ·ÂÇÏ°í ½ÍÀº ¹«¾ùÀ» ±âÁØÀ¸·Î??? ¹Ù·Î ³¯Â¥À» ±âÁØÀ¸·Î Á¢¼ÓÅë°è(count)¸¦ »Ì¾Æ º¸½Ã·Á´Â °ÅÁÒ??? ±×·¯´Ï ±×·ìÀº day1 ÀÌ µÉ°Ì´Ï´Ù.. ±×·³ À̹ø ´ÞÀÇ ÀÏÀÚ¸¦ ±âÁØÀ¸·Î ÂÞ¿í »Ì¾Æ¿Ã°Ì´Ï´Ù.... ÀÌ°É count(day1) ÇÔ¼ö¸¸ Áý¾î ³ÖÀ¸¸é ?? Ä«¿îÅÍ´Â ÀÚµ¿À¸·Î ºÙ°Ô µÇ°ÚÁÒ?? ¾î¶§¿ä?? °£´ÜÇÏÁÒ??? ±×¸®±¸ Ãâ·ÂÀ» ½ÃÅ°¸é µÇÁÒ?? ¾Æ·¡Ã³·³,,, //------------------------------------------------ mincnt=100000 maxcnt=0 do while NOT rs.eof day1=rs("day1") cnt=rs("cnt") if maxcnt < cnt then maxcnt=cnt maxday=day1 end if if mincnt > cnt then mincnt=cnt minday=day1 end if response.write day1 response.write cnt rs.movenext loop %> ÃÖ´ë Á¢¼Ó¼ö : <%=maxcnt%> ÃÖ¼Ò Á¢¼Ó¼ö : <%=mincnt%> ÃÖ´ë Á¢¼Ó¼ö¿Í ÃÖ¼ÒÁ¢¼Ó¼ö¸¦ °è»êÇÏ´Â ºÎºÐÀ̶ø´Ï´Ù...... ¹¹,,, ÀÌ Á¤µµ´Â ¼³¸íÀ» ¾Èµå·Áµµ ´Ù ÀÌÇØ ÇÏ½Ç ÁÙ·Î ¹Ï°í ¼³¸íÀ» Á¢µµ·Ï ÇÏ°Ú½À´Ï´Ù... ¸ðµÎ´ú Á¸ ÇÏ·ç µÇ½Ã±¸¿ä,,,, ¸¶±¸ ¸¶±¸ ÀÀ¿ëÇؼ ¸ÚÁø Á¢¼Ó Åë°è¸¦ ¸¸µé¾î º¸½Ã±æ..... ¹Ù¶ø´Ï´Ù. ¿À´Ãµµ Á¸ ÇÏ·ç µÇ¼¼¿ä.....
|