ÀûÓÃGlobal.ASP¶¨Ê±Ö´ÐÐASP
Using the global.asa to schedule ASP code execution.
Have you ever had some asp code that needed to execute every once in a while but, you just didn't know how to do it.
There is a solution that doesn't involve running any scheduling or scripting software on the server and is actually very easy to get working.
You see...¡¡there is thing called the "global.asa". Most ASP newbies probably wonder what the heck it even is. The Global.asa file is event driven. It can contain four event procedures: Application_OnStart, Application_OnEnd, Session_OnStart, and Session_OnEnd.
The global.asa is basically loaded into memory the first time any user views a page on your Web application. There are event procedure stubs that can contain script you want to be executed when the application starts or ends, or when the session starts or ends.
With some tricky coding you can use this file to schedule code to execute. At least around the time you need it to, this won't be able to make it execute at exactly a certain time.
Here is the 1st example. It simply keeps track of how many visitors
Ïà¹ØÎĵµ£º
<%
Function gen_key(digits)
'Create and define array
dim char_array(50)
char_array(0) = "0"
char_array(1) = "1"
char_array(2) = "2"
char_array(3) = "3"
char_array(4) = "4"
char_array(5) = "5"
char_array(6) = "6"
char_array(7) = "7"
char_array(8) = "8"
char_array(9) = "9"
char_array( ......
ÔÚ´óÐ͵ÄASPÏîÄ¿ÖУ¬ºÜ¶àµÄÒ³Ãæ¶¼Éæ¼°µ½·Ò³¹¦ÄÜ¡£Èç¹ûÿ¸öÒ³Ãæ¶¼Ð´Ò»¸ö·Ò³µÄ³ÌÐòµÄ»°£¬ÕâÑùµÄ¹¤×÷¼´½µµÍÁ˹¤×÷Ч
ÂÊ£¬Ò²²»ÀûÓÚ¹¤³ÌµÄÄ£¿é»¯£¬²»ÄÜʹ´úÂëÖØÓá£Òò´Ë£¬°Ñ·Ò³ÕâÑùµÄ¹¦ÄÜÄ£¿é»¯ÊǺÜÓбØÒªµÄ¡£
¡¡¡¡Éè¼Æ·½·¨£º
¡¡¡¡1¡¢µ÷ÓøÃÄ£¿éʱ£¬Ö»ÐèÒª´«µÝ¼Ç¼¼¯ºÍÿҳÏÔʾµÄ¼Ç¼µÄÌõÊý£»
¡¡¡¡2¡¢¿ÉÒÔµã»÷Á´½Ó½øÐз ......
Ê×ÏÈ£¬ËûÃǵÄÔËÐлúÖÆ²»Í¬¡£aspÊÇÊôÓÚÒ»ÖÖ½âÊÍÐ͵Ŀò¼Ü£¡ÊǽâÊÍÖ´Ðеģ¬Êǽű¾¡£asp.netÊDZàÒëÐ͵ģ¡×îÖÕ»á±à³Ì¶þ½øÖƵĻúÆ÷´úÂë¡£´ÓÕâÒ»µãÀ´Ëµ£¬asp.netÖ´ÐÐЧÂÊÉÏÒª±Èasp¸ß£¡
Æä´Î£¬aspÖ»ÔÊÐíʹÓÃjs»òÕßvbs¡£¶øasp.netÔò²»Ò»Ñù£¬Ö»Òª·ûºÏ¹«¹²ÓïÑÔÔËÐÐ¿â¹æ·¶µÄÓïÑÔ£¬¶¼¿ÉÒÔʹÓã¡´ÓÕâÒ»µãÉÏÀ´Ëµ£¬aspÔڵײã²Ù×÷ÉϽÏasp.ne ......
¡¡¡¡ J2MEÊÇÀûÓÃHttpConnection½¨Á¢HTTPÁ¬½Ó£¬È»ºó»ñÈ¡Êý¾Ý£¬ASPÒ²ÊÇÀûÓÃHTTPÐÒ飬Òò¶ø¿ÉÒÔÀûÓÃJ2MEÓëASP½¨Á¢Á¬½Ó£¬´Ó¶ø·ÃÎÊÊý¾Ý¿â¡£
¡¡¡¡ ASPÊÇMicroSoft¹«Ë¾µÄ·þÎñÆ÷¶Ë¶¯Ì¬Ò³Ãæ¼¼Êõ£¬¿ÉÒÔ¸ù¾ÝÇëÇóÔËÐзþÎñÆ÷¶Ë³ÌÐòÈ»ºó·µ»Ø½á¹û£¬ÕâÒ²¸øMIDPÌṩºÜ¶àÓÐÓõŦÄÜ¡£ÓÉÓÚMIDP¿Í»§¶Ë´¦ÀíÄÜÁ¦²»Ç¿£¬Òò´Ë¿ÉÒÔ°ÑһЩ´¦ÀíÈÎÎñ·ÅÔ ......