asp.netÖÐÉÏ´«´óÎļþ
Ö±½ÓÔÚASP.netÖÐÉÏ´«´óÎļþµÄ·½·¨£®
·½·¨Ò»£ºÔÚweb.configÖÐÌí¼Ó<httpRuntime maxRequestLength="100000" executionTimeout="45"/>
·½·¨¶þ£ºÐ޸ģɣɣÓÅäÖÃÎļþwindows->system32->inetsrv->metaBase.XML
·½·¨Èý£º
1£® httpHandler or HttpModule
a.ÔÚASP.net½ø³Ì´¦ÀírequestÇëÇó֮ǰ½Ø»ñrequest¶ÔÏó
b.·Ö¿é¶ÁÈ¡ºÍдÈëÊý¾Ý
c.ʵʱ¸ú×ÙÉÏ´«½ø¶È¸üÐÂmetaÐÅÏ¢
2£® ÀûÓÃÒþº¬µÄHttpWorkerRequestÓÃËüµÄGetPreloadedEntityBody ºÍ ReadEntityBody·½·¨´¦ÀíÎļþÁ÷
ÉÏ´«´úÂë
HttpApplication application1 = sender as HttpApplication;
HttpWorkerRequest request1 = (HttpWorkerRequest) ((IServiceProvider) HttpContext.Current).GetService(typeof(HttpWorkerRequest));
try
{
if (application1.Context.Request.ContentType.IndexOf("multipart/form-data") <= -1)
{
return;
}
//Check The HasEntityBody
if (!request1.HasEntityBody())
{
return;
}
int num1 = 0;
TimeSpan span1 = DateTime.Now.Subtract(this.beginTime);
string text1 = application1.Context.Request.ContentType.ToLower();
byte[] buffer1 = Encoding.ASCII.GetBytes(("\r\n--" + text1.Substring(text1.IndexOf("boundary=") + 9)).ToCharArray());
int num2 = Convert.ToInt32(request1.GetKnownRequestHeader(11));
Progress progress1 = new Progress();
application1.Context.Items.Add("FileList", new Hashtable());
byte[] buffer2 = request1.GetPreloadedEntityBody();
num1 += buffer2.Length;
string text2 = this.AnalysePreloadedEntityBody(buffer2, "UploadGUID");
if (text2 != string.Empty)
{
application1.Context.Items.Add("LionSky_UpLoadModule_UploadGUID", text2);
}
bool flag1 = true;
if ((num2 > this.UpLoadFileLength()) && ((0 > span1.TotalHours) || (span1.TotalHours &g
Ïà¹ØÎĵµ£º
ÔÚWeb±à³Ì¹ý³ÌÖУ¬´æÔÚןܶలȫÒþ»¼¡£±ÈÈçÔÚÒÔÇ°µÄASP°æ±¾ÖУ¬CookieΪ·ÃÎÊÕߺͱà³ÌÕ߶¼ÌṩÁË·½±ã£¬²¢Ã»ÓÐÌṩ¼ÓÃܵŦÄÜ¡£´ò¿ªIEä¯ÀÀÆ÷£¬Ñ¡Ôñ“¹¤¾ß”²Ëµ¥ÀïµÄ“InternetÑ¡Ï¬È»ºóÔÚµ¯³öµÄ¶Ô»°¿òÀïµ¥»÷“ÉèÖÔ°´Å¥£¬Ñ¡Ôñ“²é¿´Îļþ”°´Å¥£¬ÔÚµ¯³öµÄ´°¿ÚÖУ¬¾Í»áÏÔʾӲÅÌÀï ......
¼Ç¼һ¸öС·½·¨£¬ÈÃÈκζÔÏó¶¼ÊµÏÖjsonÐòÁкúµÄÀ©Õ¹·½·¨:
using System.Web.Script.Serialization;
...
//
public static string ToJSON(this Object obj) {
return new JavaScriptSerializer().Serialize(obj);
}
... ......
½ñÌìÎÒÖ÷ҪѧϰÁËUpdateModeÊôÐÔ¼°Ê¹ÓÃUpdateTriggers£¬°ÑÊéÖÐËù½ÌÊÚµÄÄÚÈÝÓöà¸öÀý×Óʵ¼ùÁËһϣ¬È·ÊµÃ÷°×ÁËÐí¶à¡£
UpdateMode
Ê×ÏÈÔÚÉÏһƪҲÌáµ½¹ýÕâÑùÒ»¸öÀíÂÛ£ºÔÚ̸ÂÛUpdatePanel¿Ø¼þµÄË¢ÐÂʱ£¬µ±UpdatePanel¿Ø¼þÖеÄ×ӿؼþ´¥·¢Async-Postback¶¯×÷ʱ£¬Ë¢ÐµÄÇøÓòÊ ......
Ó¦ÓóÌÐò״̬Êǿɹ© ASP.NET Ó¦ÓóÌÐòÖеÄËùÓÐÀàʹÓõÄÊý¾Ý´¢´æ¿â¡£Ëü´æ´¢ÔÚ·þÎñÆ÷µÄÄÚ´æÖУ¬Òò´ËÓëÔÚÊý¾Ý¿âÖд洢ºÍ¼ìË÷ÐÅÏ¢Ïà±È£¬ËüµÄÖ´ÐÐËٶȸü¿ì¡£ÓëÌض¨ÓÚµ¥¸öÓû§»á»°µÄ»á»°×´Ì¬²»Í¬£¬Ó¦ÓóÌÐò״̬ӦÓÃÓÚËùÓеÄÓû§ºÍ»á»°¡£Òò´Ë£¬Ó¦ÓóÌÐò״̬ÓÃÓÚ´æ´¢ÄÇЩÊýÁ¿½ÏÉÙ¡¢²»ËæÓû§µÄ±ä»¯ ......
Èý²ã¼Ü¹¹(3-tier application) ͨ³£ÒâÒåÉϵÄÈý²ã¼Ü¹¹¾ÍÊǽ«Õû¸öÒµÎñÓ¦Óû®·ÖΪ£º±íÏֲ㣨UI£©¡¢ÒµÎñÂß¼²ã£¨BLL£©¡¢Êý¾Ý·ÃÎʲ㣨DAL£©¡£Çø·Ö²ã´ÎµÄÄ¿µÄ¼´ÎªÁË“¸ßÄÚ¾Û£¬µÍñîºÏ”µÄ˼Ïë¡£
1¡¢±íÏֲ㣨UI£©£ºÍ¨Ë×½²¾ÍÊÇÕ¹ÏÖ¸øÓû§µÄ½çÃ棬¼´Óû§ÔÚʹÓÃÒ»¸öϵͳµÄʱºòËûµÄËù¼ûËùµÃ¡£
2¡¢ÒµÎñ ......