C#Àï¹ØÓÚ¶¨Ê±Æ÷Àà
¹ØÓÚC#ÖÐtimerÀà ÔÚC#Àï¹ØÓÚ¶¨Ê±Æ÷Àà¾ÍÓÐ3¸ö
1.¶¨ÒåÔÚSystem.Windows.FormsÀï
2.¶¨ÒåÔÚSystem.Threading.TimerÀàÀï
3.¶¨ÒåÔÚSystem.Timers.TimerÀàÀï
System.Windows.Forms.TimerÊÇÓ¦ÓÃÓÚWinFormÖеģ¬ËüÊÇͨ¹ýWindowsÏûÏ¢»úÖÆÊµÏֵģ¬ÀàËÆÓÚVB»òDelphiÖеÄTimer¿Ø¼þ£¬ÄÚ²¿Ê¹ÓÃAPI SetTimerʵÏֵġ£ËüµÄÖ÷ҪȱµãÊǼÆÊ±²»¾«È·£¬¶øÇÒ±ØÐëÓÐÏûϢѻ·£¬Console Application(¿ØÖÆÌ¨Ó¦ÓóÌÐò)ÎÞ·¨Ê¹Óá£
System.Timers.TimerºÍSystem.Threading.Timer·Ç³£ÀàËÆ£¬ËüÃÇÊÇͨ¹ý.NET Thread PoolʵÏֵģ¬ÇáÁ¿£¬¼ÆÊ±¾«È·£¬¶ÔÓ¦ÓóÌÐò¡¢ÏûϢûÓÐÌØ±ðµÄÒªÇó¡£System.Timers.Timer»¹¿ÉÒÔÓ¦ÓÃÓÚWinForm£¬Íêȫȡ´úÉÏÃæµÄTimer¿Ø¼þ¡£ËüÃǵÄȱµãÊDz»Ö§³ÖÖ±½ÓµÄÍÏ·Å£¬ÐèÒªÊÖ¹¤±àÂë¡£
Àý£º
ʹÓÃSystem.Timers.TimerÀà
System.Timers.Timer t = new System.Timers.Timer(10000);//ʵÀý»¯TimerÀ࣬ÉèÖüä¸ôʱ¼äΪ10000ºÁÃ룻
t.Elapsed += new System.Timers.ElapsedEventHandler(theout);//µ½´ïʱ¼äµÄʱºòÖ´ÐÐʼþ£»
t.AutoReset = true;//ÉèÖÃÊÇÖ´ÐÐÒ»´Î£¨false£©»¹ÊÇÒ»Ö±Ö´ÐÐ(true)£»
t.Enabled = true;//ÊÇ·ñÖ´ÐÐSystem.Timers.Timer.Elapsedʼþ£»
public void theout(object source, System.Timers.ElapsedEventArgs e)
{
MessageBox.Show("OK!");
}
Ïà¹ØÎĵµ£º
ÔÚasp.net開發ÖУ¬經³£會Óõ½áą́ºÍǰ̨µÄ½»»¥£¬¾Í´Ë總結ÁËÒ»點c#ºÍjavascriptÏ໥²Ù×÷µÄ·½·¨
¡¡¡¡1.ÔÚáą́c#´ú碼ÖÐ調ÓÃjacascriptµÄ·½·¨
¡¡¡¡javascript´ú碼£º
¡¡¡¡<script type="text/javascript" language="javascript">
¡¡¡¡function test()
¡ ......
/// <summary>
/// ¸ù¾ÝÖ¸¶¨²ÎÊý·µ»ØBitMap¶ÔÏó
/// ÒýÓÃÈçÏ£º
/// using System.Drawing;
/// µ÷ÓÃÀý×ÓÈçÏ£º
......
ÐÂÊÖÈçºÎѧϰc#¡¢asp.net¡¢ado.netºÍ.NET
Èç¹ûÄãÒѾÓн϶àµÄÃæÏò¶ÔÏ󿪷¢¾Ñé£¬Ìø¹ýÒÔÏÂÕâÁ½²½£º
µÚÒ»²½¡¡ÕÆÎÕÒ»ÃÅ.NETÃæÏò¶ÔÏóÓïÑÔ£¬C££»òVB.NET¡£
ÔÚûϵͳѧ¹ýÒ»ÃÅÃæÏò¶ÔÏó£¨OO£©ÓïÑÔµÄǰÌáÏÂȥѧASP.NET¡£
ASP.NETÊÇÒ»¸öÈ«ÃæÏò¶ÔÏóµÄ¼¼Êõ£¬²»¶®OO£¬ÄǾø¶Ôѧ ......
http://www.carlosag.net/Tools/CodeTranslator/ Õâ¸öÒ²Ðíѧ¼ÆËã»úµÄ¸ç¸ç½ã½ãÃÇ»áÓõõ½£¬£¬¾ÍתÁËÏ£Íû¶à¶àÖ§³ÖŶ Î÷Î÷ Óõõ½¾Í¶¥Å¶
²îµãÍüÁËŶ £¬Åº»¹ÓÐÒ»¸ösqlµÄ²å¼þºÜºÃÓõÄѽ¡£¡£¡£¡£ÓÐÏëÒªµÄ¾ÍÁôÑÔÏÂÒª¿©¡£¡£¡£¡£¡£ ......
ÒªÔÚJavaÖлñµÃijһ±äÁ¿µÄËø£¬±ØÐëÔÚ´úÂëµÄÊ×β¶þ¶Ë¼ÓÉÏsynchronized¹Ø½¡×Ö£¬Ö¸Ã÷ÐèÒª»ñµÃËøµÄ¶ÔÏó¡£Ò»µ©Ï߳̿ªÊ¼Ö´ÐÐsynchronized¿éÖеĴúÂ룬Ëü¾Í»ñµÃÁ˶ÔÕâÒ»¶ÔÏóµÄËøµÄ¿ØÖÆÈ¨¡£Í¬Ñù£¬Ò»µ©Ïß³ÌÒѾÀ뿪ÁËsynchronized¿é£¬ËüÒ²½«ÊÍ·ÅÕâÒ»¶ÔÏóµÄËø¡£ÎÒÃÇÒѾ֪µÀ£¬C#Ò²ÓÐÒ»¸öÏàËÆµÄ±»³Æ×÷lockµÄ¹Ø½¡×Ö¡£³ýÁËlockÕâ¸ö¹Ø½¡×Ö ......