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

ASP.NET


      Ó¦ÓóÌÐò״̬Êǿɹ© ASP.NET Ó¦ÓóÌÐòÖеÄËùÓÐÀàʹÓõÄÊý¾Ý´¢´æ¿â¡£Ëü´æ´¢ÔÚ·þÎñÆ÷µÄÄÚ´æÖУ¬Òò´ËÓëÔÚÊý¾Ý¿âÖд洢ºÍ¼ìË÷ÐÅÏ¢Ïà±È£¬ËüµÄÖ´ÐÐËٶȸü¿ì¡£ÓëÌض¨ÓÚµ¥¸öÓû§»á»°µÄ»á»°×´Ì¬²»Í¬£¬Ó¦ÓóÌÐò״̬ӦÓÃÓÚËùÓеÄÓû§ºÍ»á»°¡£Òò´Ë£¬Ó¦ÓóÌÐò״̬ÓÃÓÚ´æ´¢ÄÇЩÊýÁ¿½ÏÉÙ¡¢²»ËæÓû§µÄ±ä»¯¶ø±ä»¯µÄ³£ÓÃÊý¾Ý¡£
 
1¡¢Ê¹ÓÃÓ¦ÓóÌÐò״̬
Ó¦ÓóÌÐò״̬´æ´¢ÔÚ HttpApplicationState ÀàµÄʵÀýÖС£´ËÀ๫¿ª¶ÔÏóµÄ¼üÖµ×ֵ䡣
ÔÚÓû§³õ´Î·ÃÎÊÓ¦ÓóÌÐòÖеÄÈκΠURL ×ÊԴʱ£¬½«»á´´½¨ HttpApplicationState ʵÀý¡£HttpApplicationState Ààͨ³£Í¨¹ý HttpContext ÀàµÄ Application ÊôÐÔ·ÃÎÊ¡£
¿ÉÒÔͨ¹ýÁ½ÖÖ·½Ê½Ê¹ÓÃÓ¦ÓóÌÐò״̬¡£¿ÉÒÔͨ¹ý´úÂëÖ±½Ó¶Ô Contents ¼¯ºÏÖеÄÖµ½øÐÐÌí¼Ó¡¢·ÃÎÊ»òÒƳý²Ù×÷¡£ÔÚÓ¦ÓóÌÐòÔËÐÐʱ£¬¿ÉÒÔËæʱ·ÃÎÊ HttpApplicationState Àà¡£µ«¸ÃÀàͨ³£ÓÃÓÚÔÚÓ¦ÓóÌÐòÆô¶¯Ê±¼ÓÔØÓ¦ÓóÌÐò״̬Êý¾Ý¡£Îª´Ë£¬¿ÉÏò Global.asax ÎļþÖÐµÄ Application_Start ·½·¨ÖÐÌí¼Ó¼ÓÔØÓ¦ÓóÌÐò״̬µÄ´úÂë¡£
´ËÍ⣬»¹¿ÉÒÔÔÚ Web Ó¦ÓóÌÐòµÄ Global.asax ÎļþÖÐͨ¹ý <object runat="server"> ÉùÃ÷Ïò StaticObjects ¼¯ºÏÌí¼Ó¶ÔÏó¡£Ëæºó£¬¾Í¿ÉÒÔÔÚÓ¦ÓóÌÐòÖеÄÈκεط½Í¨¹ý´úÂë¶ÔÓÃÕâÖÖ·½·¨¶¨ÒåµÄÓ¦ÓóÌÐò״̬½øÐзÃÎÊ¡£ÏÂÃæµÄʾÀýÑÝʾÁËÓ¦ÓóÌÐò״ֵ̬µÄ¶ÔÏóÉùÃ÷£º
<object runat="server" scope="application" ID="MyInfo"
    PROGID="MSWC.MYINFO">
</object>
      Ö»ÄÜÔÚ Global.asax ÎļþÖÐÏò StaticObjects ¼¯ºÏÌí¼Ó¶ÔÏó¡£Èç¹ûÊÔͼֱ½Óͨ¹ý´úÂëÌí¼Ó¶ÔÏ󣬸ü¯ºÏ½«Òý·¢ NotSupportedException¡£
²»±ØÒýÓà Application ¼¯ºÏ£¬¾Í¿ÉÒÔ·ÃÎÊÓ¦ÓóÌÐò״̬Öд洢µÄ¶ÔÏó³ÉÔ±¡£ÏÂÃæµÄ´úÂëʾÀýÑÝʾÁËÈçºÎÒýÓÃÔÚÓ¦ÓóÌÐò״̬µÄ StaticObjects ¼¯ºÏÖж¨ÒåµÄ¶ÔÏó³ÉÔ±£º
protected void Page_Load(Object sender, EventArgs e)
    Label1.Text = MyInfo.Title;
End Sub
 
2¡¢Ó¦ÓóÌÐò״̬עÒâÊÂÏî
ʹÓÃÓ¦ÓóÌÐò״̬ʱ£¬±ØÐë×¢ÒâÒÔÏÂÖØÒªÊÂÏ
·×ÊÔ´   ÓÉÓÚÓ¦ÓóÌÐò״̬´æ´¢ÔÚÄÚ´æÖУ¬Òò´Ë±È½«Êý¾Ý±£´æµ½´ÅÅÌ»òÊý¾Ý¿âÖÐËٶȸü¿ì¡£µ«ÊÇ£¬ÔÚÓ¦ÓóÌÐò״̬Öд洢½Ï´óµÄÊý¾Ý¿é¿ÉÄÜ»áºÄ¾¡·þÎñÆ÷Äڴ棬Õâ»áµ¼Ö·þÎñÆ÷½«ÄÚ´æ·ÖÒ³µ½´ÅÅÌ¡£³ýÁËʹÓÃÓ¦ÓóÌÐò״̬֮Í⣬»¹¿ÉÒÔʹÓà ASP.NET »º´æ»úÖÆÀ´´æ´¢´óÁ¿µÄÓ¦ÓóÌÐòÊý¾


Ïà¹ØÎĵµ£º

dz̸ASP.net°²È«±à³Ì

ÔÚWeb±à³Ì¹ý³ÌÖУ¬´æÔÚןܶలȫÒþ»¼¡£±ÈÈçÔÚÒÔÇ°µÄASP°æ±¾ÖУ¬CookieΪ·ÃÎÊÕߺͱà³ÌÕ߶¼ÌṩÁË·½±ã£¬²¢Ã»ÓÐÌṩ¼ÓÃܵŦÄÜ¡£´ò¿ªIEä¯ÀÀÆ÷£¬Ñ¡Ôñ“¹¤¾ß”²Ëµ¥ÀïµÄ“InternetÑ¡Ï¬È»ºóÔÚµ¯³öµÄ¶Ô»°¿òÀïµ¥»÷“ÉèÖÔ°´Å¥£¬Ñ¡Ôñ“²é¿´Îļþ”°´Å¥£¬ÔÚµ¯³öµÄ´°¿ÚÖУ¬¾Í»áÏÔʾӲÅÌÀï ......

asp.net¿Í»§¶Ë½Å±¾µ÷ÓÃÒ³Ãæ·½·¨

  µÚÒ»²½£º
½«Ä³¸öÒ³ÃæµÄ·½·¨ ÓÐ webmethod  attribute;
[WebMethod]
//Ö»ÄÜÊÇ public static µÄ·½·¨
public static DateTime GetCurrentTime()
{
return DateTime.UtcNow;
}
µÚ¶þ²½£º
 Ò³ÃæÓÐÒ»¸öScriptManager ÉèÖÃËüµÄenablepagemethod=true;
asp:ScriptManager ID="Scri ......

ASP.NET2.0Á¬½ÓORACLE½â¾ö·½°¸

½çÃæ: Default.aspx
 
½çÃæÉÏÌí¼ÓµÄ¿Ø¼þ:
Á½¸öTextBox: tEmail(ÓÃÓÚÊäÈëÓû§email),tPassword(ÓÃÓÚÊäÈë×¢²áÃÜÂë)
Ò»¸öButton: bReg
Ò»¸öLabel: lLable(ÓÃÓÚ×¢²á³É¹¦ºóÏÔʾӦ´ð)
DemoµÄ´úÂë: Default.aspx.cs
ÎÒÃÇÏÈ°ÑÊý¾ÝµÄÁ¬½Ó×Ö·û´®Ð´ÔÚWeb.configÀï:
<appSettings>
<add key="oracleconn" value= ......

ASP.NET

      ÿ´Î½«ÍøÒ³·¢Ë͵½·þÎñÆ÷ʱ£¬¶¼»á´´½¨ÍøÒ³ÀàµÄÒ»¸öÐÂʵÀý¡£ÔÚ´«Í³µÄ Web ±à³ÌÖУ¬Õâͨ³£Òâζ×ÅÔÚÿһ´ÎÍù·µÐгÌÖУ¬Óë¸ÃÒ³¼°¸ÃÒ³ÉϵĿؼþÏà¹ØÁªµÄËùÓÐÐÅÏ¢¶¼»á¶ªÊ§¡£ÀýÈ磬Èç¹ûÓû§½«ÐÅÏ¢ÊäÈëµ½Îı¾¿ò£¬¸ÃÐÅÏ¢½«ÔÚ´Óä¯ÀÀÆ÷»ò¿Í»§¶ËÉ豸µ½·þÎñÆ÷µÄÍù·µÐгÌÖжªÊ§¡£
ΪÁ˽â¾ö´«Í³µÄ Web ±à³Ìµ ......

ASP.NET


      ÊÓͼ״̬ÊÇ ASP.NET Ò³¿ò¼ÜÓÃÓÚÔÚÍù·µ¹ý³ÌÖ®¼ä±£ÁôÒ³ºÍ¿Ø¼þÖµµÄ·½·¨¡£ÔÚ³ÊÏÖÒ³µÄ HTML ±ê¼Çʱ£¬±ØÐëÔڻط¢¹ý³ÌÖб£ÁôµÄÒ³ºÍÖµµÄµ±Ç°×´Ì¬½«±»ÐòÁл¯Îª Base64 ±àÂë×Ö·û´®¡£È»ºó£¬´ËÐÅÏ¢½«±»·ÅÈëÒ»¸ö»ò¶à¸öÊÓͼ״̬Òþ²Ø×ֶΡ£
 
1¡¢·½°¸
ÊÓͼ״̬ÓÉ ASP.NET Ò³¿ò¼Ü×Ô¶¯ÓÃÓÚ±£´æÔÚ¸ ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ