ASP.NETÒ³Ãæ¶ÔÏó – User
»ñÈ¡Óйط¢³öÒ³ÇëÇóµÄÓû§µÄÐÅÏ¢¡£
Ò»¡¢HttpContext Àà
·â×°Óйظö±ð HTTP ÇëÇóµÄËùÓÐ HTTP Ìض¨µÄÐÅÏ¢¡£
HttpContext ÀàÐ͹«¿ªÒÔϳÉÔ±¡£
¹¹Ô캯Êý
Ãû³Æ
˵Ã÷
HttpContext
ÒÑÖØÔØ¡£ ³õʼ»¯ LinePragmaCodeInfo ÀàµÄÒ»¸öÐÂʵÀý¡£
·½·¨
Ãû³Æ
˵Ã÷
AddError
½«Òì³£Ìí¼Óµ½µ±Ç° HTTP ÇëÇóµÄÒì³£¼¯ºÏÖС£
ClearError
Çå³ýµ±Ç° HTTP ÇëÇóµÄËùÓдíÎó¡£
Equals
È·¶¨Ö¸¶¨µÄ Object ÊÇ·ñµÈÓÚµ±Ç°µÄ Object¡£ £¨¼Ì³Ð×Ô Object¡££©
Finalize
ÔÊÐí Object ÔÚ“À¬»ø»ØÊÕ”»ØÊÕ Object ֮ǰ³¢ÊÔÊÍ·Å×ÊÔ´²¢Ö´ÐÐÆäËûÇåÀí²Ù×÷¡£ £¨¼Ì³Ð×Ô Object¡££©
GetAppConfig
Òѹýʱ¡£ Ϊµ±Ç°Ó¦ÓóÌÐò·µ»ØÇëÇóµÄÅäÖÃÐÅÏ¢¡£
GetConfig
Òѹýʱ¡£ Ϊµ±Ç° HTTP ÇëÇó·µ»ØËùÇëÇóµÄÅäÖÃÐÅÏ¢¡£
GetGlobalResourceObject
ÒÑÖØÔØ¡£ »ñÈ¡Ó¦ÓóÌÐò¼¶±ðµÄ×ÊÔ´¡£
GetHashCode
ÓÃ×÷Ìض¨ÀàÐ͵ĹþÏ£º¯Êý¡£ £¨¼Ì³Ð×Ô Object¡££©
GetLocalResourceObject
ÒÑÖØÔØ¡£ »ñÈ¡Ò³¼¶±ðµÄ×ÊÔ´¡£
GetSection
»ñÈ¡µ±Ç°Ó¦ÓóÌÐòµÄĬÈÏÅäÖõÄÖ¸¶¨ÅäÖýڡ£
GetType
»ñÈ¡µ±Ç°ÊµÀýµÄ Type¡£ £¨¼Ì³Ð×Ô Object¡££©
MemberwiseClone
´´½¨µ±Ç° Object µÄdz±í¸±±¾¡£ £¨¼Ì³Ð×Ô Object¡££©
RemapHandler
ÓÃÓÚΪÇëÇóÖ¸¶¨´¦Àí³ÌÐò¡£
RewritePath
ÒÑÖØÔØ¡£ Ö¸¶¨ÄÚ²¿ÖØд·¾¶£¬²¢ÔÊÐíÇëÇóµÄ URL Óë×ÊÔ´µÄÄÚ²¿Â·¾¶²»Í¬¡£RewritePath ÓÃÔÚÎÞ Cookie »á»°×´Ì¬ÖС£
ToString
·µ»Ø±íʾµ±Ç° Object µÄ String¡£ £¨¼Ì³Ð×Ô Object¡££©
ÊôÐÔ
Ãû³Æ
˵Ã÷
AllErrors
»ñÈ¡ÔÚ´¦Àí HTTP ÇëÇóµÄ¹ý³ÌÖÐÀÛ»ýµÄ´íÎóÊý×é¡£
Application
Ϊµ±Ç° HTTP ÇëÇó»ñÈ¡ HttpApplicationState ¶ÔÏó¡£
ApplicationInstance
Ϊµ±Ç° HTTP ÇëÇó»ñÈ¡»òÉèÖà HttpApplication ¶ÔÏó¡£
Cache
»ñÈ¡µ±Ç°Ó¦ÓóÌÐòÓòµÄ Cache ¶ÔÏó¡£
Current
Ϊµ±Ç° HTTP ÇëÇó»ñÈ¡»òÉèÖà HttpContext ¶ÔÏó¡£
CurrentHandler
»ñÈ¡±íʾµ±Ç°ÕýÔÚÖ´ÐеĴ¦Àí³ÌÐòµÄ IHttpHandler ¶ÔÏó¡£
CurrentNotification
»ñÈ¡Ò»¸ö RequestNotification Öµ£¬¸Ãֵָʾµ±Ç°ÕýÔÚ´¦ÀíµÄ HttpApplication ʼþ¡£
Error
»ñÈ¡ÔÚ´¦Àí HTTP ÇëÇóµÄ¹ý³ÌÖÐÀÛ»ýµÄµÚÒ»¸ö´íÎó£¨Èç¹ûÓУ©¡£
Handler
»ñÈ¡»òÉèÖøºÔð´¦Àí HTTP ÇëÇóµÄ IHttpHandler ¶ÔÏó¡£
IsCustomErrorEnabled
»ñÈ¡Ò»¸öÖµ£¬¸ÃֵָʾÊÇ·ñÒÑΪµ±Ç° HTTP ÇëÇóÆôÓÃ×Ô¶¨Òå´íÎó¡£
IsDebuggingEnabled
»ñÈ¡Ò»¸öÖµ£¬¸Ãֵָʾµ±Ç° HTTP ÇëÇóÊÇ·
Ïà¹ØÎĵµ£º
ÔÚWeb±à³Ì¹ý³ÌÖУ¬´æÔÚןܶలȫÒþ»¼¡£±ÈÈçÔÚÒÔÇ°µÄASP°æ±¾ÖУ¬CookieΪ·ÃÎÊÕߺͱà³ÌÕ߶¼ÌṩÁË·½±ã£¬²¢Ã»ÓÐÌṩ¼ÓÃܵŦÄÜ¡£´ò¿ªIEä¯ÀÀÆ÷£¬Ñ¡Ôñ“¹¤¾ß”²Ëµ¥ÀïµÄ“InternetÑ¡Ï¬È»ºóÔÚµ¯³öµÄ¶Ô»°¿òÀïµ¥»÷“ÉèÖÔ°´Å¥£¬Ñ¡Ôñ“²é¿´Îļþ”°´Å¥£¬ÔÚµ¯³öµÄ´°¿ÚÖУ¬¾Í»áÏÔʾӲÅÌÀï ......
µÚÒ»²½£º
½«Ä³¸öÒ³ÃæµÄ·½·¨ ÓÐ webmethod attribute;
[WebMethod]
//Ö»ÄÜÊÇ public static µÄ·½·¨
public static DateTime GetCurrentTime()
{
return DateTime.UtcNow;
}
µÚ¶þ²½£º
Ò³ÃæÓÐÒ»¸öScriptManager ÉèÖÃËüµÄenablepagemethod=true;
asp:ScriptManager ID="Scri ......
½çÃæ: Default.aspx
½çÃæÉÏÌí¼ÓµÄ¿Ø¼þ:
Á½¸öTextBox: tEmail(ÓÃÓÚÊäÈëÓû§email),tPassword(ÓÃÓÚÊäÈë×¢²áÃÜÂë)
Ò»¸öButton: bReg
Ò»¸öLabel: lLable(ÓÃÓÚ×¢²á³É¹¦ºóÏÔʾӦ´ð)
DemoµÄ´úÂë: Default.aspx.cs
ÎÒÃÇÏÈ°ÑÊý¾ÝµÄÁ¬½Ó×Ö·û´®Ð´ÔÚWeb.configÀï:
<appSettings>
<add key="oracleconn" value= ......
Ò»¡¢Cookie ¸ÅÊö
1¡¢·½°¸
Cookie ÌṩÁËÒ»ÖÖÔÚ Web Ó¦ÓóÌÐòÖд洢Óû§Ìض¨ÐÅÏ¢µÄ·½·¨¡£ÀýÈ磬µ±Óû§·ÃÎÊÄúµÄÕ¾µãʱ£¬Äú¿ÉÒÔʹÓà Cookie ´æ´¢Óû§Ê×Ñ¡Ïî»òÆäËûÐÅÏ¢¡£µ±¸ÃÓû§ÔٴηÃÎÊÄúµÄÍøվʱ£¬Ó¦ÓóÌÐò±ã¿ÉÒÔ¼ìË÷ÒÔÇ°´æ´¢µÄÐÅÏ¢¡£
2¡¢±³¾°
Cookie ÊÇһС¶ÎÎı¾ÐÅÏ¢£ ......