ASP.net MVCÓëRESTful ROA»¹ÊÇÓеãÇø±ðµÄ
ÒÔ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.com/blog/123,»ñȡչʾblog idΪ123µÄblog
*. http://www.gaotianpu.com/blog/Edit/123,ÐÞ¸Ä
get,չʾ±à¼ÓõÄhtml±íµ¥
post,½ÓÊܱ༺óµÄÊý¾Ý
*. http://www.gaotianpu.com/blog/Delete/123,ɾ³ý
ͨ³£¶¼ÓÃget·½·¨Ö´ÐÐ.
MVC»áÔÚurlÖÐÏÔʾµÄ¸ø³ö×ÊÔ´µÄ²Ù×÷·½·¨,ÁíÍ⣬MVC»¹Òª¸ºÔðÊä³öÓû§½»»¥½çÃæ¡£
¶øRESTful ROA˼ÏëÔò»áÕâÑù¹æ»®URL
http://www.gaotianpu.com/blog/123
ʹÓÃHttp MethodÀ´Çø·ÖÕë¶Ô¸Ã×ÊÔ´µÄ²Ù×÷£º
*. get,»ñÈ¡id=123µÄblog
*. put,ÐÞ¸Äid=123µÄblog
*. delete,ɾ³ýid=123µÄblog
http://www.gaotianpu.com/blog/,
*. post£¬±íʾ´´½¨Ò»ÐÂblog¡£
(ΪÁ˱£Ö¤ÃݵȲÙ×÷£¬¼´·ÀÖ¹Öظ´Ìá½»ÏàͬÄÚÈÝ£¬post·½·¨»á¸½¼ÓÒ»¸öguid²ÎÊý£¬ÈôÁ½´ÎÌá½»µÄguid²ÎÊýÏàͬ£¬Ôò±íʾÖظ´Ìá½»£¬ºóÒ»´ÎÌá½»µÄ¸²¸ÇÇ°Ò»´Î¡£)
*. get ,¼ÓÔØblogÁбí.
µ±È»£¬ÆÕͨµÄweb formÊDz»Ö§³Öput,delete,head,optionµÈÕâÑùµÄÌØÊâhttp·½·¨µÄ£¬µ«¿ÉÒÔÔÚpost»ù´¡ÉÏÄ£ÄâµÃµ½.
Ϊʲô»áÓÐÕâÑùµÄÇø±ðÄØ£¿
RESTful Web Service,¾ÍÊÇÓÃÀ´Ìṩweb·þÎñµÄ£¬ºÍasp.net mvc²»Í¬£¬Ëü¿ÉÒÔ²»¿¼ÂÇÓû§½»»¥½çÃæ¡£
±ÈÈç˵,µ±´´½¨¡¢ÐÞ¸Äһƪblogʱ£¬asp.net mvcͬһurlÒªÖ§³Ö2ÖÖ·½·¨:get,¸øÓû§Ò»¸ö¿É²Ù×÷µÄ½çÃ棬post½ÓÊÜÓû§Ìá½»µÄÊý¾Ý£¬
¶ørestÔò²»Óÿ¼ÂǸøÓû§ÕâÑùµÄ²Ù×÷½çÃ棬²Ù×÷½çÃæÒªÓÉ¿Í»§¶ËÍê³É¡£
¶þÕß²»´æÔÚËÌ滻ˣ¬Ë±È˸üºÃµÄÎÊÌâ¡£
¼òµ¥±È½ÏÁËһϣ¬¸öÈ˾õµÃʹÓÃASP.net MVC À´ÊµÏÖRESTful webservice»¹ÊÇÓÐЩǣǿµÄ£¬²»ÖªµÀWCFÊÇÈçºÎ´¦ÀíRESTfull web serivceµÄ £¿
×îа汾£ºhttp://www.gaotianpu.com/blog/detail/248
Ïà¹ØÎĵµ£º
ʹÓÃASP.NET 2.0 Profile´æ´¢Óû§ÐÅÏ¢[·Òë] Level 200
×÷Õß: Stephen Walther
ÔÎĵØÖ·£ºhttp://msdn.microsoft.com/asp.net/default.aspx?pull=/library/en-us/dnvs05/html/UserProfiles.asp
ÒëÕߣºTony Qu
¸ÅÒª£ºÐí¶àASP.NETÓ¦ÓóÌÐòÐèÒª¿ç·ÃÎʵÄÓû§ÊôÐÔ¸ú×Ù¹¦ÄÜ£¬ÔÚASP.NET1.1ÖУ¬ÎÒÃÇÖ»ÄÜÈ˹¤ÊµÏÖÕâÒ»¹¦ÄÜ¡£µ«Èç ......
ASP.NET»ñÈ¡¿Í»§¶ËIP/Óû§ÃûµÈÐÅÏ¢
1. ÔÚASP.NETÖÐרÓÃÊôÐÔ£º
»ñÈ¡·þÎñÆ÷µçÄÔÃû£ºPage.Server.ManchineName
»ñÈ¡Óû§ÐÅÏ¢£ºPage.User
»ñÈ¡¿Í»§¶ËµçÄÔÃû£ºPage.Request.UserHostName
»ñÈ¡¿Í»§¶ËµçÄÔIP£ºPage.Request.UserHostAddress
2. ÔÚÍøÂç±à³ÌÖеÄͨÓ÷½·¨£º
»ñÈ¡µ±Ç°µçÄÔÃû£ºstatic System. ......
×î½üÔÚ¹úÍâµÄÍøÕ¾ÂÒ×ßһͨ£¬·¢ÏÖһЩ±È½ÏºÃµÄÎÄÕ£¬ÊÕ¼¯ÕûÀí¼ÓÓÚ×Ô¼ºµÄÀí½â£¬×÷Ϊ±Ê¼ÇÐÎʽ¼Ç¼ÏÂÀ´£¬ÈÃÒÔºó×Ô¼ºÓиö»ØÒä¡£
¡¡¡¡ASP.NETÊÇÒ»¸ö·Ç³£Ç¿´óµÄ¹¹½¨WebÓ¦ÓõÄƽ̨,ËüÌṩÁ˼«´óµÄÁé»îÐÔºÍÄÜÁ¦ÒÔÖÂÓÚ¿ÉÒÔÓÃËüÀ´¹¹½¨ËùÓÐÀàÐ͵ÄWebÓ¦ÓÃ.¾ø´ó¶àÊýµÄÈËÖ»ÊìϤ¸ß²ãµÄ¿ò¼ÜÈçWebFormsºÍWebS ......
¾ÍÊÇÔÚʹÓÃjmail·¢ËÍÓʼþʱ£¬Ê¹ÓõÄÊÇ×Ô¶¯É¨Ãè¹æ¶¨¼ä¸ôʱ¼ä×Ô¶¯·¢Ë͵ģ¬ÏÖÔÚÊÇÏëʵÏÖÒѾ·¢Ë͵ÄÓʼþ½«²»ÔÙ·¢ËÍ£¬¸÷λ´óϺÔõôʵÏÖ£¬ÇóÖú£¡
Ê×ÏÈÃ÷È·µÄÊÇÔÚÊý¾Ý¿â±íÖв¢Ã»Óбêʶ×Ö¶ÎÀ´±æ±ðÓʼþÊÇ·ñÒѾ·¢ËÍ¡£Èç¹ûÎÒÀ´ÉèÖÃÒ»¸öÈ«¾Ö±äÁ¿À´´æ´¢ÕâЩÒѾ·¢ËÍÓʼþµÄID£¬È»ºóÔÚÔÙ´ÎɨÃèʱÀ´±æ±ðÕâЩIDÊÇ·ñÒѾ´æÔڵķ½Ê½À´Åжϣ¬¸ ......
asp.net ¶ÔxmlÎļþµÄ¶Áд,Ìí¼Ó,ÐÞ¸Ä,ɾ³ý²Ù×÷
ÏÂÃæÓдúÂëµ÷ÊÔÕýÈ·
using System;
using System.Collections;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Web;
using System.Web.SessionState;
using System.Web.UI;
using&nb ......