asp.net¶¨Ê±·¢ËÍÓʼþ×ܽá (ת)
Ïã¸ÛÄDZ߹«Ë¾µÄÊг¡²¿¿ª»áʱҪÇóÎÒÃÇÕâ±ßʵÏÖÒ»¸ö¶¨Ê±·¢ËÍÓʼþµÄ¹¦ÄÜ£¬¼´ÔÚÿÌìÏÂÎç5µã×óÓÒ¶¨Ê±°Ñ½ñÌìÒÑͨ¹ýÈýÉóµÄ¶©µ¥ÐÅÏ¢·¢¸øÊг¡²¿µÄ¾Àí£¬¸æËßËûÄÄЩ¶©µ¥ÒѾͨ¹ýÁËÖÕÉó¡£Æ½Ê±Ö»ÖªµÀÈçºÎÓÃ.net·¢ËÍÓʼþ£¬µ«²»ÖªÈçºÎ¶¨Ê±·¢ËÍÓʼþ¡£ÓÚÊÇ°Ù¶ÈÁËһϣ¬×ܽáÆðÀ´ÓÐÒÔÏÂÄÇôÈýÖÖ£º
£¨1£©×öÒ»¸öwinform À´¶¨Ê±·¢Óʼþ¡£È»ºóͨ¹ýwindows¼Æ»®ÈÎÎñ£¬ÉèÖÃΪָ¶¨Ê±¼ä£¬Ã¿´Î×Ô¶¯ÔËÐУ¬ÔËÐÐÍê±Ïºó×Ô¶¯¹Ø±Õ¡£
£¨2£©ÓÃsqlserver Êý¾Ý¿âʵÏÖ·¢Óʼþ£¬ÓÃsqlserverʵÏÖ·¢ÓʼþµÄ´æ´¢¹ý³Ì£¬È»ºóÖƶ¨Ò»¸ö×÷Òµ£¬Öƶ¨Ê±¼äÔËÐС£
£¨3£©ÔÚ Global.asax ÎļþÀï±à³Ì¡£Ê¼þ£ºApplication_Start¡£ÀûÓÃTimeÀà±à³Ì¡£±ÈÈç·þÎñÆ÷1ÃëÖÓÖ´ÐÐÒ»´ÎÅжϡ£
Ïã¸ÛÄDZߵĹ«Ë¾µÄERPôéͳÊÇBSģʽ£¬ÓÉÓÚ¶Ô·½¹«Ë¾·þÎñÆ÷»·¾³Ìõ¼þÓë½â¾ö·½°¸Òª¼òµ¥µÄÏÞÖÆ£¬ÎÒºÍÎÒʦ¸µ¾ö¶¨ÓõÚÈýÖÖ·½·¨¡£ÔÚ±à³Ì֮ǰ£¬ÏȽéÉÜÒ»ÏÂGlobal.asaxÎļþÀïµÄ¼¸¸ö·½·¨¡£
protected void Application_Start(Object sender, EventArgs e)
{
//Application_start·½·¨£ºÇëÇó ASP.NET Ó¦ÓóÌÐòÖеÚÒ»¸ö×ÊÔ´£¨ÈçÒ³£©Ê±µ÷Óá£ÔÚÓ¦ÓóÌÐòµÄÉúÃüÖÜÆÚÆÚ¼ä½öµ÷ÓÃÒ»´Î
}
protected void Application_End(Object sender, EventArgs e)
{
//Application_end·½·¨£ºÔÚжÔØÓ¦ÓóÌÐò֮ǰ¶Ôÿ¸öÓ¦ÓóÌÐòÉúÃüÖÜÆÚµ÷ÓÃÒ»´Î¡£
}
ÏÂÃæÊǾßÌåµÄ×ö·¨£º
´úÂë
protected void Application_Start(Object sender, EventArgs e)
{
Timer t = new Timer(60000);//Éè¼Æʱ¼ä¼ä¸ô£¬Èç¹ûÒ»¸öСʱִÐÐÒ»´Î¾Í¸ÄΪ3600000 £¬ÕâÀïÒ»·ÖÖÓµ÷ÓÃÒ»´Î
t.Elapsed += new ElapsedEventHandler(t_Elapsed);
t.AutoReset = true;
t.Enabled = true;
}
private void t_Elapsed(object sender, ElapsedEventArgs e)
{
Ïà¹ØÎĵµ£º
ÔÚ½« ASP.NET Web ²¿¼þµÄ¼¯³É¿Ø¼þ¼¯ÖеĿؼþ°üÀ¨ÔÚÍøÒ³ÖÐʱ£¬ÕâЩ¿Ø¼þ½«×ñÊظÃÒ³µÄ¹æÔò£»¾ßÌå¶øÑÔ¾ÍÊÇ£¬ÕâЩ¿Ø¼þ½«ÔÚ¸ÃÒ³µÄÉúÃüÖÜÆÚÄÚÔËÐС£
ÿ¸öÍøÒ³¶¼¾ßÓÐÒ»¸öÉúÃüÖÜÆÚ£¬ÍøÒ³ÔÚÆäÉúÃüÖÜÆÚÄÚ½«Ö´ÐÐһϵÁд¦Àí²½Öè¡£ÕâЩ²½Öè°üÀ¨³õʼ»¯¡¢´´½¨¿Ø¼þ¡¢»¹ÔºÍά»¤×´Ì¬¡¢ÔËÐÐʼþ´¦Àí³ÌÐò´ú ......
ASP.NET Web ²¿¼þ¿Ø¼þ¼¯ÊÇÒ»×éÐͬ¹¤×÷µÄ×é¼þ£¬Ê¹Äú¿ÉÒÔ´´½¨×îÖÕÓû§¿ÉÒÔÖ±½Ó´Óä¯ÀÀÆ÷ÐÞ¸ÄÆäÓû§½çÃæ (UI) µÄÍâ¹ÛºÍÐÐΪµÄÍøÒ³¡£±¾¸ÅÊöº¸ÇÁË Web ²¿¼þ¿Ø¼þ¼¯µÄ»ù±¾·½Ã棬°üÀ¨×î³£ÓõĿؼþÒÔ¼°´´½¨ Web ²¿¼þÒ³ËùÐèµÄ»ù±¾ Web ²¿¼þ×é¼þµÄ˵Ã÷¡£
Ò»¡¢Web ²¿¼þ×é¼þµÄÀà±ð
Web ²¿¼þ¿Ø¼þ¼¯Ó ......
1.ʹÓà ʹÓÃResponse.Write£¬ÕâÖÖ·½·¨»á°ÑJS´úÂëдÔÚÒ³ÃæµÄ×²¿(µÄÇ°Ãæ)£º
2. ʹÓ㺠page.ClientScript.RegisterStartupScript£¨£©£» ÕâÖÖ·½·¨»á°ÑJS´úÂëǶÈëÔÚÒ³ÃæµÄµ×²¿¡¢±íµ¥µÄ×îºó (Ç°Ãæ)£¬ÊÊÓÃÓÚÒªÔÚÒ³Ãæ¿Ø¼þ¼ÓÔØÍê³ÉºóÔËÐеÄJS´úÂë
3.ʹÓÃRegisterClientScriptBlock£¨£©£»ÕâÖÖ·½·¨»á°ÑJS´úÂëǶÈëÔÚÒ³ÃæµÄ¶¥²¿¡¢ ......