asp.netµÄÄÚÖöÔÏó
ASP.NETµÄÄÚÖöÔÏó½éÉÜ
1.Response
2.Request
3.Server
4.Application
5.Session
6.Cookie
Request¶ÔÏóÖ÷ÒªÊÇÈ÷þÎñÆ÷È¡µÃ¿Í»§¶Ëä¯ÀÀÆ÷µÄһЩÊý¾Ý,°üÀ¨´ÓHTML±íµ¥ÓÃPost»òÕßGET·½·¨´«µÝµÄ²ÎÊý¡¢CookieºÍÓû§ÈÏÖ¤¡£ÒòΪRequest¶ÔÏóÊÇPage¶ÔÏóµÄ³ÉÔ±Ö®Ò»£¬ËùÒÔÔÚ³ÌÐòÖв»ÐèÒª×öÈκεÄÉùÃ÷¼´¿ÉÖ±½ÓʹÓã»ÆäÀàÃûΪ HttpRequestÊôÐԺܶ࣬µ«·½·¨ºÜÉÙ£¬Ö»ÓÐÒ»¸öBinaryRead()
1.ʹÓÃRequest.FormÊôÐÔ»ñÈ¡Êý¾Ý
ͨ¹ý¸ÃÊôÐÔ£¬¶ÁÈ¡Ö®¼äµÄ±íµ¥Êý¾Ý.×¢Ò⣺Ìá½»·½Ê½ÒªÉèÖÃΪ¡°Post¡±¡£ÓëGet·½·¨Ïà±È½Ï£¬Ê¹ÓÃPost·½·¨¿ÉÒÔ½«´óÁ¿Êý¾Ý·¢Ë͵½·þÎñÆ÷¶Ë
2.ÀûÓÃRequest.QueryStringÊôÐÔ»ñÈ¡Êý¾Ý
Request¶ÔÏóµÄQueryStingÊôÐÔ¿ÉÒÔ»ñÈ¡ HTTP ²éѯ×Ö·û´®±äÁ¿¼¯ºÏ ¡£ ͨ¹ý¸ÃÊôÐÔ£¬ÎÒÃÇ¿ÉÒÔ¶ÁÈ¡µØÖ·ÐÅÏ¢ http://localhost/aaa.aspx?uid=tom&pwd=abcÆäÖбêʶΪºìÉ«²¿·ÖµÄÊý¾Ý.×¢Ò⣺Ìá½»·½Ê½ÒªÉèÖÃΪ¡°Get¡±
3.ÎÊÌ⣺Request.FormÓÃÓÚ±íµ¥Ìá½»·½Ê½ÎªPostµÄÇé¿ö£¬¶øRequest.QueryStringÓÃÓÚ±íµ¥Ìá½»·½Ê½ÎªGetµÄÇé¿ö£¬Èç¹ûÓÃ´í£¬Ôò»ñÈ¡²»µ½Êý¾Ý¡£½â¾ö·½·¨£ºÀûÓÃRequest(¡°ÔªËØÃû¡±)À´¼ò»¯²Ù×÷¡£
4.Request.ServerVariables("»·¾³±äÁ¿Ãû³Æ")
ÀàËƵĻ¹ÓУºUserHostAddress,Browser,Cookies,ContentType,IsAuthenticatedItem,ParamsResponse¶ÔÏóÓÃÓïÊä³öÊý¾Ýµ½¿Í»§¶Ë£¬°üÀ¨Ïòä¯ÀÀÆ÷Êä³öÊý¾Ý¡¢Öض¨Ïòä¯ÀÀÆ÷µ½ÁíÒ»¸öURL»òÏòä¯ÀÀÆ÷Êä³öCookieÎļþ¡£ÆäÀàÃûΪhttpResponseÊôÐԺͷ½·¨¡£
Write() Ïò¿Í»§¶Ë·¢ËÍ×Ö·û´®ÐÅÏ¢
BufferOutPutÊôÐÔ ÊÇ·ñʹÓûº´æ
Clear() Çå³ý»º´æ
Flush() Ç¿ÖÆÊä³ö»º´æµÄËùÓÐÊý¾Ý
Redirect() ÍøҳתÏòµØÖ·
End() ÖÕÖ¹µ±Ç°Ò³µÄÔËÐÐ
WriteFile() ¶ÁÈ¡Ò»¸öÎļþ£¬²¢ÇÒдÈë¿Í»§¶ËÊä³öÁ÷ (ʵÖÊ£º´ò¿ªÎļþ£¬²¢ÇÒÊä³öµ½¿Í»§¶Ë¡£)
1.Response.Write ±äÁ¿Êý¾Ý»ò×Ö·û´®
Response.Write (±äÁ¿Êý¾Ý»ò×Ö·û´®)
Response.Write("")
Response.Write(" ")
2.Response¶ÔÏóµÄRedirect·½·¨½«¿Í»§¶Ëä¯ÀÀÆ÷Öض¨Ïòµ½ÁíÍâµÄURLÉÏ£¬¼´Ìøתµ½ÁíÒ»¸öÍøÒ³¡£ÀýÈç:Response.Redirect("http://www.example.com/")
3. Response.End() ÖÕÖ¹µ±Ç°Ò³µÄÔËÐÐ
4.Response.WriteFile(FileName)ÆäÖУºFileName Ö¸´úÐèÏòä¯ÀÀÆ÷Êä³öµÄÎļþµÄÎļþÃû
Server¶ÔÏóÌṩ¶Ô·þÎñÆ÷Éϵķ½·¨ºÍÊôÐÔ½øÐеķÃÎÊ .ÆäÀàÃû³ÆÊÇHttpServerUtility.
Server¶ÔÏóµÄÖ÷ÒªÊôÐÔÓУº
MachineName£º»ñÈ¡·þÎñÆ÷µÄ¼ÆËã»úÃ
Ïà¹ØÎĵµ£º
ÔÚÒÔÇ°µÄASPʱºò£¬µ±ÇëÇóÒ»¸ö*.aspÒ³ÃæÎļþµÄʱºò£¬Õâ¸öHTTPÇëÇóÊ×ÏȻᱻһ¸öÃûΪinetinfo.exe½ø³ÌËù½Ø»ñ£¬Õâ¸ö½ø³Ìʵ¼ÊÉϾÍÊÇwww·þÎñ¡£½Ø»ñÖ®ºóËü»á½«Õâ¸öÇëÇóת½»¸øasp.dll½ø³Ì£¬Õâ¸ö½ø³Ì¾Í»á½âÊÍÕâ¸öaspÒ³Ã棬Ȼºó½«½âÊͺóµÄÊý¾ÝÁ÷·µ»Ø¸ø¿Í»§¶Ëä¯ÀÀÆ÷¡£ÆäʵASP.DLLÊÇÒ»¸öÒÀ¸½ÔÚIISµÄISAPIÎļþ£¬Ëü¸ºÔðÁ˶ÔÖîÈçASPÎļþ£¬A ......
ÒÔblogϵͳΪÀý£¬Ò»¸ö¼òµ¥µÄblogϵͳģÐÍ°üÀ¨£º
1.·¢±íһƪеÄblog
2.ÏÔʾһƪblog
3.ÐÞ¸Äһƪblog
4.ɾ³ýһƪblog
ASP.net MVC»áÊÇÕâÑùµÄURL¹æ»®£º
*. http://www.gaotianpu.com/blog/create,´´½¨
get·½·¨¸øÓû§Õ¹Ê¾Ò»¸öhtml±íµ¥,¹©Óû§Ìá½»Êý¾Ý
post·½·¨½ÓÊÜÓû§Ìá½»µÄÊý¾Ý£¬²åÈëµ½db
*. http://www.gaotianpu. ......
ASP.NET´¦Àí³ÌÐòºÍÄ£¿é
ASP.NET HTTP ´¦Àí³ÌÐò(Handler)ÊÇÏìÓ¦¶Ô ASP.NET Web Ó¦ÓóÌÐòµÄÇëÇó¶øÔËÐеijÌÐò
Èç´¦Àí *.aspxÎļþµÄASP.NET´¦Àí³ÌÐò ......
//postÇëÇó
string name = Request["name"].toString();
string name =Request.Form.Get("name").toString();
//getÇëÇó
string name = Request.QueryString["name"].toString();
µ«ÎÒ·¢ÏÖ ÎÞÂÛÊÇ·ñÊÇpostÓëget´«Öµ¶¼¿ÉÓÃ
string name = Request["name"].toString();
±íµ¥Ìá½»ÖÐgetºÍpost·½Ê½µÄÇø±ð¹éÄ ......