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

Asp.Net½â¾öSession¶ªÊ§


ÔÚasp.netÀïÃ棬ºÜ¶àʱºòʹÓÃsessionÀ´±£´æһЩ¶ÔÏ󣬱ÈÈç˵¹ºÎï³µµÈµÈ£¬Óкܶàʱºò£¬¾ÍËãÄãÉèÖÃÁËsession³¬Ê±µÄʱ¼ä£¬session»¹ÊÇ»áÎÞÔµÎ޹ʵĶªÊ§£¬ÕâÀïÓÐÒ»ÖֱȽϼòµ¥µÄ·½·¨¿ÉÒÔÉèÖÃsession¶ªÊ§µÄʱ¼ä¡£
ÔÚweb.configÀïÃæÈçÏÂÅäÖÃ
    <sessionState 
            mode="StateServer"
            stateConnectionString="tcpip=127.0.0.1:42424"
            sqlConnectionString="data source=127.0.0.1;Trusted_Connection=yes"
            cookieless="false" 
            timeout="30000" stateNetworkTimeout="144000"
    />
ÆäʵÕâ¾ä»°¾ÍÊÇÀûÓ÷þÎñÆ÷À´±£´æsession£¬ÕâÑù¾Í²»»á¶ªÊ§£¬µ±È»£¬»¹ÒªÔÚ·þÎñÆ÷ÉϽøÐÐÅäÖá£
ÎҵĵçÄÔ-->ÓÒ¼üµã¹ÜÀí-->µã¿ª·þÎñ-->ÕÒµ½asp.net_state Õâ¸ö·þÎñ,Ò²¾ÍÊÇasp.net״̬·þÎñ,ÆôÓþÍÐÐÁË,È»ºóÔÙµ½Global.asax.csÕÒµ½
        protected void Session_Start(Object sender, EventArgs e)
        {
            Session.Timeout = 30000;
        }
ÉèÖó¬Ê±Ê±¼ä
ÕâÑù¾ÍÐÐÁË~~


Ïà¹ØÎĵµ£º

ÔÚasp.net Ï ¿ØÖÆ̨Êä³ö

ÒÔÇ°×ö.NET winformµÄʱºò£¬Ò»Ö±¶¼ÊÇÓà Console.WriteÏò¿ØÖÆ̨Êä³öÐÅÏ¢µÄ£¬Õâ´Î×öwebµÄʱºò£¬·¢ÏÖÕâ¸öÓï¾äÓò»ÁË¡£
²éÁËÒ»ÏÂ×ÊÁÏ£¬²Å·¢ÏÖweb³ÌÐòÖ´ÐÐʱ£¬ÊDZ»¸½¼Óµ½IIS½ø³ÌµÄÒ»¸öµ¥¶ÀµÄAppDomainÖеģ¬ËùÒÔ¾ÍËãÓÐÊä³öÒ²¿´µ½£¬ËùÒÔConsole.Writeµ÷ÊÔÐÅÏ¢ÎÞ·¨ÏÔʾ³öÀ´¡£
ÄÇô½â¾ö°ì·¨ÊÇ£¬ÓÃdebug´úÌ棺
System.Diagnostics ......

ASP.NETÉú³É¾²Ì¬Ò³Ãæ·½·¨´óÈ«

·½°¸1£º
/// <summary>
/// ´«ÈëURL·µ»ØÍøÒ³µÄhtml´úÂë
/// </summary>
/// <param name="Url">URL</param>
/// <returns></returns>
public static string getUrltoHtml(string Url)
{
errorMsg = "";
try
{
System.Net.WebRequest wReq = System.Net.WebReque ......

ASP.NET³ÌÐòÖг£ÓõÄÈýÊ®ÈýÖÖ´úÂë

1. ´ò¿ªÐµĴ°¿Ú²¢´«ËͲÎÊý£º
¡¡¡¡´«ËͲÎÊý£º
response.write("£¼script£¾window.open(’*.aspx?id="+this.DropDownList1.SelectIndex+"&id1="+...+"’)£¼/script£¾")
¡¡¡¡½ÓÊÕ²ÎÊý£º
string a = Request.QueryString("id");
string b = Request.QueryString("id1");
¡¡¡¡2.Ϊ°´Å¥Ìí¼Ó¶Ô»°¿ò
Button1 ......

ÔÚasp.netÖÐ×Ô¶¯¸øurlµØÖ·¼ÓÉϳ¬Á´½Ó

 ÒªÏë×Ô¶¯ÏÔʾ³¬Á´½ÓµÄ¹Ø¼üÔÚÓÚÈçºÎÄÜÕýȷʶ±ð³¬Á´½Ó£¬ºÁÎÞÒÉÎʵģ¬×îÓÐЧµÄ·½·¨ÊÇÓÃÕýÔò±í´ïʽ¡£ÕýÔò±í´ïʽÊÇÓÉÆÕͨ×Ö·û£¨ÀýÈç×Ö·û a µ½ z£©ÒÔ¼°ÌØÊâ×Ö·û£¨³ÆΪԪ×Ö·û£©×é³ÉµÄÎÄ×Öģʽ£¬ÃèÊöÁËÒ»ÖÖ×Ö·û´®Æ¥ÅäµÄģʽ£¬¿ÉÒÔÓÃÀ´¼ì²éÒ»¸ö´®ÊÇ·ñº¬ÓÐijÖÖ×Ó´®¡¢½«Æ¥ÅäµÄ×Ó´®×öÌæ»»»òÕß´Óij¸ö´®ÖÐÈ¡³ö·ûºÏij¸öÌõ¼þµÄ×Ó´®µÈ¡ ......

asp.net»ñÈ¡µ±Ç°Ê±¼ä

ÔÚc# / ASP.netÖÐÎÒÃÇ¿ÉÒÔͨ¹ýʹÓÃDataTimeÕâ¸öÀàÀ´»ñÈ¡µ±Ç°µÄʱ¼ä¡£Í¨¹ýµ÷ÓÃÀàÖеĸ÷ÖÖ·½·¨ÎÒÃÇ¿ÉÒÔ»ñÈ¡²»Í¬µÄʱ¼ä£ºÈ磺ÈÕÆÚ£¨2008-09-04£©¡¢Ê±¼ä£¨12£º12£º12£©¡¢ÈÕÆÚ+ʱ¼ä£¨2008-09-04 12£º11£º10£©µÈ¡£
//»ñÈ¡ÈÕÆÚ+ʱ¼ä
DateTime.Now.ToString();            // 2008- ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ