asp.net ???????????
?????tqxiaofang ???????[ 2017/6/8 9:41:45 ] ????????.NET ??????????? ????
????1.Response????
????Response??????HttpResponse???????????????HTTP???????????????????????????????????ν??????????????????????????????
??????1??Response?????????
????Buffer????????????????塣
????BufferOutput:???????????????????????????????
????Cache :???Web?????????????????????????仯?????
????Charset :????????????????HTTP???????
????ContentEncoding:?????????????????????
????ContentType:????????????????HTTP MIME?????
????Expires:????????????????????????????????????????????????????????????????????????汾????Expires????????????ASP?汾?????
????ExpiresAbsolute:????????y???????????????????????????????ExpiresAbsolute????????????ASP?汾?????
????Filter:???????????????????????????????????????????HTTP??????塣
????IsClientConnected:??????????????????????????
????Output:???????HTTP???????????????
????OutputStream:???????Http?????????????????????
????Status:???÷????????????????
????StatusCode:????????÷?????????????HTTP?????????HTTP?????????????????????????????????
????StatusDescription:????????÷???????????????HTTP?????????
????SuppressContent :???HTTP??????????????
??????2??Response????????
????BinaryWrite??????????????????д??HTTP???????
????Clear??????????????е??????????????
????ClearContent??????????????е??????????
????ClearHeaders??????????????е???????????
????Close??????????????????????
????End??????????л???????????????????????????У???????Application_EndRequest?????
????Flush????????????????л?????????Flush??????End??????????????????????????????????????Flush??End????????????Flush??????????С?
????Write??????????д????????????????????????
????WriteFile??????????????д????????????
????Redirect?????????????????????????????
????2. Request????
????Request???????????System.Web????????е?HttpRequest??????????????????????ASP.NET??????????????????????????Request?????У???Щ??????????????????Header???????????????????????????????????????????POST??GET?????????????????
??????1??Request?????????
????AcceptTypes???????????MIME?????????????????顣
????ApplicationPath??????????ASP.Net??ó??????????ó????·????
????Browser???й??????????????????????????????
????ClientCertificate??????????????????顣
????ContentEncoding???????????????????????
????ContentLength???????????????????????????????
????ContentType???????????MIME?????????
????Cookies???????????cookie??????
????CurrentExecutionFilePath??????????????·????
????FilePath??????????????·????
????Form??????????????
????Headers??HTTP?????
????IsAuthenticated???????????????
????HttpMethod???????????HTTP?????????????GET??POST??HEAD????
????IsSecureConnection??HTTP?????????e??????????HTTPS????
????Path??????????????·????
????PhysicalApplicationPath???????????е????????ó??????????????????·????
????QueryString??HTTP?????????????????
????PhysicalPath????????????URL???????????????·????
????RawUrl????????????URL??
????RequestType???????????HTTP???????????GET??POST????
????ServerVariables?????Web????????????????
????Url???й????????URL???????
????UserAgent????????????????????????
????UserHostAddress?????????????????
????UserHostName????????DNS?????
????UserLanguages??????????????????????????顣
??????2??Request???????(1)——?????????????
??????Web??ó????У??????????????????????Щ??????????????浽???????????Request?????????????????????????????????????????????????Request????????????QueryString??Form???????????????????
????1.????????POST??????????????????Form?????????????????
??????÷?????Request.Form[“?????”]
????2.????????GET??????????????????QueryString??????????????
??????÷?????Request.QueryString[“?????”]
????3.Request???????(2)——????????????????
???????Request?????Browser??????????????????????????????????????HttpBrowserCapabilities????HttpBrowserCapabilities????????????? ?????
????4.Request???????(3)——???????????????
???????Request??????????????????????????????????????UserAgent?????????????????????????????????UserHostAddress??????????????????????
???????????Request????Headers?????????HTTP??????????
????3.Server????
????Server?????????????Web?????????????????????????????????????????
????Server??????????????????
????MachineName?????????????????????????
????ScriptTimeout????????????????????????????????
????GetLastError???????????????????????????????????????÷??????????????????ClearError???????????????????
????Transfer?????????????????????У????????????????????
????MapPath????????÷?????Web????????????????·???????????????·????
????HTMLEncode?????????????????????????????б???
????HTMLDecode????????HTMLEncode?????????????
????UrlEncode?????????????????????б???
????UrlDecode??????UrlEncode???????????
????4. Application????
????Application????????????????????????ASP.NET?????????????????????????????????Application???????????????????????????????????????????????Response?????Request???????????????????κζ????????????????????á?
????Application?????????洢???????????????????α???????????????????????????????????????洢????????????????????????μ?????????????Application????????????????????????????????乲???
??????1??Application?????????????
????Count?????Application???????????????
????Get?????????????????????????????
????GetKey????????????????????????
????Add(name??value)??????????????name????value??Application?????????
????Set(name??value)?????????name??Application????????????
????Clear??????????Application?????????
????Remove(name)??????????name??Application?????????
????Lock??????????Application?????????
????UnLock?????????????Application?????????
??????2??Application???????????
????OnStart????????????????????ASP.NET??????????ASP.NET??????У?
????OnEnd?????????????????????ASP.NET??????У??????????????????????д???????У????????????????????????????????????
???????Application????????????????????????
????Application??????????????????????????????????????????????洢??????????л?????????С?
????Application??????????????????????????????????????洢????
????5.Session????
????ASP.NET???????????Session????洢????????????????????????????????????????η???Session????????????????????
????1)??????????????η????Session???????????????????Session?????????乲?????????Session??г????????Abandon??????б??????Session?е???????????Session????????????乲?????????Application?????????????????乲???????
????2)???????????η?????Session??????????η???????????????????
??????1??Session?????????????
????SessionID??????????????????????????????????????????????????????????SessionID??SessionID?????????????(Session)??
????TimeOut?????????????????????????????κλ?????????λ??????
????Abandon??????÷????????????????Session???????????????????????Abandon?????????Session_OnEnd?????
????Add(name??value)???????????name????value??Session??????
????Clear?????????Session??????
????RemoveAll?????????Session??????
????Remove(name)??????????name??Session??????
????RemoveAt(index)??????????index??Session??????
????CopyTo??????????????????????????????С?
??????2??Session????????????
????Session_OnStart?????????????Session?????????
????Session_OnEnd??????????Session????????????????????????????Abandon???????????á?
????6. Cookie????
??????Web????????У??????????????????4K???????????????????????????????????????????Web????????з????
????Cookie?????????????Cookie??Cookie??
??????Cookie????????????????????????ж???????????????????????????????????????????????????Cookie???????
????Cookie???????洢????????????????????????????????????????á?
??????????????????????Cookie????????????Cookie????????????????????Cookie?????Cookie??
??????1??Cookie?????????????
????Expires????????????Cookie?????????????????1000?????
????Name???????????Cookie???????
????Value??????????????Cookie???
????Values?????????Cookie?????а??????????????
????Add????Cookie?????????????????
??????2??Cookie????÷???
????Cookies????????Page?????÷???Application??Session???????
????1?????????Cookie
????HttpCookie Cookie??????=new HttpCookie(Cookie??)??
????2????Cookie?????????????
????Cookie??????. values. Add(??????)??
????3????Cookieд???????
????Response.AppendCookie(Cookie??????);
????4?????Cookie????
????HttpCookie Cookie??????=Request.Cookies[“Cookie??”];
????5?????Cookie?????е??
????Cookie.values[“???????”];
??????3??????Cookie????????
????Cookie?????Expires????????????????Cookie???????????????????????????????????????
???????磺
???????ù???????2011-09-09??
????myCookie.Expires =Convert.ToDateTime("2011-09-09");
?????????????????
????myCookie.Expires = DateTime.MaxValue;
???·???
??????????????????
2023/3/23 14:23:39???д?ò??????????
2023/3/22 16:17:39????????????????????Щ??
2022/6/14 16:14:27??????????????????????????
2021/10/18 15:37:44???????????????
2021/9/17 15:19:29???·???????·
2021/9/14 15:42:25?????????????
2021/5/28 17:25:47??????APP??????????
2021/5/8 17:01:11