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

asp.netÖÐÏÔʾÔÚÏßÓû§


asp.netÖÐÏÔʾÔÚÏßÓû§
private static System.Threading.Timer timer;
private const int interval = 1000 * 60 * 20;//¼ì²éÔÚÏßÓû§µÄ¼ä¸ôʱ¼ä
/// <summary>
/// ±ØÐèµÄÉè¼ÆÆ÷±äÁ¿¡£
/// </summary>
private System.ComponentModel.IContainer components = null;
public Global()
{
InitializeComponent();
}
protected void Application_Start(Object sender, EventArgs e)
{
if (timer == null)
timer = new System.Threading.Timer(new System.Threading.TimerCallback(ScheduledWorkCallback),
sender, 0, interval);
DataTable userTable = new DataTable();
userTable.Columns.Add("UserID");//Óû§ID
userTable.Columns.Add("UserName");//Óû§ÐÕÃû
userTable.Columns.Add("FirstRequestTime");//µÚÒ»´ÎÇëÇóµÄʱ¼ä
userTable.Columns.Add("LastRequestTime");//×îºóÒ»´ÎÇëÇóµÄʱ¼ä
userTable.Columns.Add("ClientIP");//
userTable.Columns.Add("ClientName");//
userTable.Columns.Add("ClientAgent");//
userTable.PrimaryKey = new DataColumn[]{userTable.Columns[0]};
userTable.AcceptChanges();
Application.Lock();
Application["UserOnLine"] = userTable;
Application.UnLock();
}
protected void Session_Start(Object sender, EventArgs e)
{
}
protected void Application_BeginRequest(Object sender, EventArgs e)
{
}
protected void Application_EndRequest(Object sender, EventArgs e)
{
}
protected void Application_AcquireRequestState(Object sender, EventArgs e)
{
if(sender == null) return;
if(!(sender is HttpApplication)) return;
HttpApplication mApp = (HttpApplication)sender;
if(mApp.Context.Session == null) return;
if(mApp.Context.Session["UserID"]==null ) return;
string userID = mApp.Context.Session["UserID"].ToString();
if(Application["UserOnLine"] == null) return;
if(!(Application["UserOnLine"] is DataTable)) return;
DataTable userTable = (DataTable)Application["UserOnLine"];
DataRow curRow = userTable.Rows.Find(new object[]{userID});
if(curRow != null)
{
this.GetDataRowfromHttpApp(mApp,ref curRow);
}
else
{
DataRow newRow = userTable.NewRow();
this.GetDataRowfromHtt


Ïà¹ØÎĵµ£º

asp.net(c#) static¹Ø¼ü×ÖÓ÷¨Ð¡½á[zz]

http://ayic1.blog.163.com/blog/static/27343030200965103528805/
¾²Ì¬±äÁ¿
       µ±ÎÒÃDZàдһ¸öÀàʱ£¬Æäʵ¾ÍÊÇÔÚÃèÊöÆä¶ÔÏóµÄÊôÐÔºÍÐÐΪ£¬¶ø²¢Ã»ÓвúÉúʵÖÊÉϵĶÔÏó£¬Ö»ÓÐͨ¹ýnew¹Ø¼ü×ֲŻá²úÉú³ö¶ÔÏó£¬Õâʱϵͳ²Å»á·ÖÅäÄÚ´æ¿Õ¼ä¸ø¶ÔÏó£¬Æä·½·¨²Å¿ÉÒÔ¹©Íⲿµ÷Óá£
  & ......

ASP.NET¿çÒ³Ãæ´«Öµ

½ñÌìTMȺÀïÓÐÈËÎÊÆð¹ØÓÚÒ³Ãæ´«ÖµµÄ·½·¨£¬ÓÖÒý·¢ÁËÒ»³¡ÌÖÂÛ¡£¿´À´Õâ¸ö»¹ÊÇÓкܶàÈ˹Ø×¢µÄ£¬Òò´ËÎÒ¾ÍÎÒ¸öÈ˹۵ã×öÁËЩ×ܽᣬϣÍû¶Ô´ó¼ÒÓÐËù°ïÖú¡£
¡¡¡¡1.  ʹÓÃQueryString±äÁ¿
¡¡¡¡¡¡¡¡QueryStringÊÇÒ»Öַdz£¼òµ¥µÄ´«Öµ·½Ê½£¬Ëû¿ÉÒÔ½«´«Ë͵ÄÖµÏÔʾÔÚä¯ÀÀÆ÷µÄµØÖ·À¸ÖС£Èç¹ûÊÇ´«µÝÒ»¸ö»ò¶à¸ö°²È«ÐÔÒªÇ󲻸߻òÊǽṹ¼òµ ......

ÈçºÎѧϰASP.NET

ÈçºÎѧϰASP.NET
2009-07-24 09:49
Èç¹ûÄãÒѾ­Óн϶àµÄÃæÏò¶ÔÏ󿪷¢¾­Ñ飬Ìø¹ýÒÔÏÂÕâÁ½²½£º
µÚÒ»²½ ÕÆÎÕÒ»ÃÅ.NETÃæÏò¶ÔÏóÓïÑÔ£¬C££»òVB.NET¡£
ÎÒÇ¿ÁÒ·´¶ÔÔÚûϵͳѧ¹ýÒ»ÃÅÃæÏò¶ÔÏóÓïÑÔµÄÇ°ÌáÏÂȥѧASP.NET¡£
ASP.NETÊÇÒ»¸öÈ«ÃæÏò¶ÔÏóµÄ¼¼Êõ£¬²»¶®ÃæÏò¶ÔÏó£¬ÄǾø¶Ôѧ²»ÏÂÈ¥£¡
µÚ¶þ²½ ¶Ô.NET FrameworkÀà¿âÓÐÒ»¶¨µÄ ......

Asp.NetÔÚÏßͳ¼ÆÓû§Áбí

1¡¢ÔÚÏßÓû§ÁбíµÄʵÏÖ
ÔÚASPʱ´ú£¬ÒªÊµÏÖÒ»¸öÍøÕ¾µÄÔÚÏßÓû§ÁбíÏÔʾ¹¦ÄܵĹßÓÃ×ö·¨ÊÇÐÞ¸Äglobal.asaÎļþÖеģºApplication_Start¡¢Session_StartºÍSession_EndÕâÈý¸öº¯Êý¡£ÔÚASP.NETʱ´ú£¬ÎÒÒÀÈ»ÕâÑù×ö¡£µ«ÊDZØÐë×¢ÒâºÜ¶àÎÊÌâ¡£Ê×ÏÈÀ´¿´¿´×î¼òµ¥µÄ´úÂëʵÏÖ£º
protected void Application_Start(Object sender, EventArg ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ