Ò׽ؽØÍ¼Èí¼þ¡¢µ¥Îļþ¡¢Ãâ°²×°¡¢´¿ÂÌÉ«¡¢½ö160KB

asp.net¶¨Ê±Ö´ÐдúÂë

string LogPath;
Thread thread;
void WriteLog()
{
while (true)
{
StreamWriter sw = new StreamWriter(LogPath, true, Encoding.UTF8);
sw.WriteLine(thread.Name + ":" + DateTime.Now.ToString());
sw.Close();
Thread.CurrentThread.Join(1000 * 60);//×èÖ¹1·ÖÖÓ
}
}
void Application_Start(object sender, EventArgs e)
{
LogPath = HttpContext.Current.Server.MapPath("log.txt");
//ÔÚÓ¦ÓóÌÐòÆô¶¯Ê±ÔËÐеĴúÂë
thread = new Thread(new ThreadStart(WriteLog));
thread.Name = "дµÇ¼ÈÕÖ¾Ïß³Ì";
thread.Start();
}


Ïà¹ØÎĵµ£º

ASP.NETÔËÐÐÔ­Àí¸ÅÊö


1.ASP.NETÔËÐÐÔ­Àí¸ÅÊö
¡¡¡¡ÈçÉÏͼ£¬µ±Ò»¸öhttpÇëÇó·¢Ë͹ýÀ´²¢±»IIS»úÊÕµ½Ö®ºó,IISÊ×ÏÈͨ¹ýÄãÇëÇóµÄÒ³ÃæÀàÐÍΪÆä¼ÓÔØÏàÓ¦µÄdllÎļþ£¬È»ºóÔÚ´¦Àí¹ý³ÌÖн«ÕâÌõÇëÇó·¢Ë͸øÄܹ»´¦ÀíÕâÌõÇëÇóµÄÄ£¿é,¶øÔÚASP.NETÖÐÕâ¸öÄ£¿é¾Í½Ð×öHttpHandler,ΪʲôaspxÕâÑùµÄÎļþ¿ÉÒÔ±»·þÎñÆ÷´¦Àí,ÄÇÊÇÒòΪÔÚ·þÎñÆ÷¶ËÓÐĬÈϵÄHttpHandlerרÃÅ´ ......

ASP.NET α¾²Ì¬


asp.netʵÏÖα¾²Ì¬

Ò»¡¢Î±¾²Ì¬µÄÓô¦
ÓÐЩÓû§
¾õµÃ£¬Î±¾²Ì¬ºÍÕæ¾²Ì¬Êµ¼Ê±»ÊÕ¼Á¿»áÏà²îºÜ´ó£¬Æäʵ²»È»£¬´ÓÄã¸öÈ˽Ƕȣ¬Äã
È¥ÅжÏÒ»ÏÂÒ»¸öÌû×Óµ½µ×ÊÇÕæ¾²Ì¬»¹ÊÇα¾²Ì¬£¿¹À¼ÆºÜÄÑ¿´µÃ³ö£¬ÒòΪËùν¾²Ì¬µÄÒâ˼£¬¾ÍÊǵØÖ·Öв»´øÎʺţ¬²»´øÎʺŵľÍÊǾ²Ì¬£¬¹ÜËûÊÇÕæµÄ»¹ÊÇαµÄ£¿ËÑË÷Òý
Çæ¿´µÃ³öÂð£¿ËùÒÔ˵£¬Æäʵ² ......

ASP.NET MVC postÌá½»±íµ¥ ºǫֵ́Ϊ¿Õ

×òÌìÓöµ½ÁËÒ»¸öСÎÊÌâ,Ìá½»±íµ¥µÄʱºò,ºǫ́µÄactionÖÐÑéÖ¤µÄ±íµ¥ÀïµÄ¿Ø¼þÖµ¾ÓÈ»ÊÇ¿ÕÖµ,µ÷À´µ÷È¥²»µÃÆä·¨.
ÎÒÔÚǰ̨µÄ±íµ¥Àï¿Ø¼þÓõÄÊDZê×¼html¿Ø¼þ
Ò³ÃæÉÏʹÓÃÏÂÃæÓï¾ä·¢ËÍform
<%using (Html.BeginForm("AddNewPicGroups", "MetaData")){ %>
ºǫ́ʹÓÃÈçÏÂÓï¾ä½ÓÊÕʱȴ½ÓÊÕ²»µ½Êý¾Ý
public ActionResult AddNew ......

[ת]asp.net get setÓ÷¨

     ÔÚÔçÆÚѧϰc#µÄ¹ý³ÌÖУ¬¾­³£Óöµ½ÕâÑùµÄÓï¾ä£º
public string StudentName
{
get{return stuName;}
set{stuName=value;}
}
  
      µ±Ê±Ò²²»ÊǺÜÃ÷°×ΪʲôҪÕâÑù£¿Ñ§ÉîÁËc#ºó£ ......

asp.net·ÀÖ¹ÖØ¸´Ìá½»Êý¾Ý

protected void Page_Load(object sender, EventArgs e)
...{
this.btnOK.Attributes.Add("onclick", ClientScript.GetPostBackEventReference(btnOK, "Click") + ";this.disabled=true; this.value='Ìá½»ÖÐ...';");
}
//°´Å¥´¦Àí·½·¨
protected void btnOK_C ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØÍ¼ | ¸ÓICP±¸09004571ºÅ