Ò׽ؽØÍ¼Èí¼þ¡¢µ¥Îļþ¡¢Ãâ°²×°¡¢´¿ÂÌÉ«¡¢½ö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 ¶Ô·¾¶***µÄ·ÃÎʱ»¾Ü¾ø

ÔÚwindows 2003ÏÂ,ÔÚÔËÐÐwebÓ¦ÓóÌÐòµÄʱºò³öÏÖһϴíÎó:
        ·þÎñÆ÷ÎÞ·¨´¦ÀíÇëÇ󣬣­£­£¾¶Ô·¾¶“C:\temp\mytest.txt”µÄ·ÃÎʾܾø
˵Ã÷: Ö´Ðе±Ç° Web ÇëÇóÆÚ¼ä£¬³öÏÖδ´¦ÀíµÄÒì³£¡£Çë¼ì²é¶ÑÕ»¸ú×ÙÐÅÏ¢£¬ÒÔÁ˽âÓйظôíÎóÒÔ¼°´úÂëÖе¼Ö´íÎóµÄ³ö´¦µÄÏêϸÐÅÏ¢¡£
Òì³ ......

ASP.NETÒ³ÃæË¢ÐµÄʵÏÖ·½·¨

µÚÒ»£º
C# code
private void Button1_Click( object sender, System.EventArgs e )
{
Response.Redirect( Request.Url.ToString( ) );
}
µÚ¶þ£º
C# code
private void Button2_Click( object sender, System.EventArgs e )
{
Response.Write( " < script language=javascript>window.location.h ......

ASP.NET ºÍ IIS ÅäÖÃ×Ô¶¨ÒåÀ©Õ¹ÃûÍøÒ³

¿´¹ý΢ÈíµÄÍøÕ¾ÓÐʱºò£¬ÊÇ.MSPXµÄÀ©Õ¹Ãû£¿ÆäʵÄãÒ²¿ÉÒÔÅäÖ㬺ܼòµ¥¡£Here We Go!
ÅäÖÃWEB.CONFIG£º
<system.web>
    <compilation>
       <buildProviders>
          <add  ......

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ºÅ