ASP.NETÉÏ´«´óÎļþ½â¾ö·½°¸
Õâ´ÎÔÚÏîÄ¿ÖУ¬Óõ½ÁË´óÎļþÉÏ´«£¬ÒªÉÏ´«µÄÎļþÓÐ100¶àm£¬ÓÚÊÇÑо¿ÏÖÔÚ¹úÄÚʹÓõĴóÎļþÉÏ´«µÄ
×é¼þ·¢ÏÖÓõıȽ϶àµÄÓÐÁ½¸ö¿Ø¼þAspnetUpload 2.0ºÍLion.Web.UpLoadModule£¬ÁíÍ⻹ÓÐ˼¹éÔÚËüµÄ²©
¿ÍÌÃÖÐËù˵µÄ°ì·¨ http://blog.joycode.com/saucer/archive/2004/03/16/16225.aspx
Á½¸ö¿Ø¼þµÄ·½·¨ÊÇ£ºÀûÓÃÒþº¬µÄHttpWorkerRequest£¬ÓÃËüµÄGetPreloadedEntityBody ºÍ
ReadEntityBody·½·¨´ÓIISΪASP.NET½¨Á¢µÄpipeÀï·Ö¿é¶ÁÈ¡Êý¾Ý¡£Chris HynesΪÎÒÃÇÌṩÁËÕâÑùµÄÒ»¸ö
·½°¸(ÓÃHttpModule)£¬¸Ã·½°¸³ýÁËÔÊÐíÄãÉÏ´«´óÎļþÍ⣬»¹ÄÜʵʱÏÔʾÉÏ´«½ø¶È¡£
Lion.Web.UpLoadModuleºÍAspnetUpload Á½¸ö.NET×é¼þ¶¼ÊÇÀûÓõÄÕâ¸ö·½°¸¡£
µ±ÉÏ´«µ¥Îļþʱ£¬Á½¸öÈí¼þµÄ·½·¨ÊÇÒ»ÑùµÄ£¬¼Ì³ÐHttpModule
¸´ÖÆ ±£´æ
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;
}
in
Ïà¹ØÎĵµ£º
ÅäÖÃASP.NETƽ̨ʱÓöµ½µÄ“·ÃÎÊIISÔªÊý¾Ý¿âʧ°Ü”²»ÖªµÀΪʲô½ñÌìÎÒµÄIISÍ£Ö¹ÁË£¬Í£Ö¹ÁËÎÒ¾ÍÆô¶¯Ï°ѣ¬¿ÉÊÇÆô¶¯²»ÆðÀ´Ñ½£¬ÄÇÔõô°ìѽ£¬Îʰٶȣ¬È˼Ò˵µÄÓиö·þÎñworld wide web Publishing ·þÎñ£¬¿ÉÊÇÎÒ»ú×ÓÉÏÁ¬Õâ¸ö·þÎñ¶¼Ã»ÓУ¬Ã»°ì·¨ÕÒ°Ñ£¬ÕÒÁ˰ëÌìûÕÒµ½£¬Ö»ÓдÓа²×°ÁË£¬°²×°Á˺ÃÁË£¬Æô¶¯ÁË£¬ÓÖ³öÏ ......
//TransmitFileʵÏÖÏÂÔØ
protected void Button1_Click(object sender, EventArgs e)
{
/*
΢ÈíΪResponse¶ÔÏóÌṩÁËÒ»¸öÐµķ½·¨TransmitFileÀ´½â¾öʹÓÃResponse.BinaryWrite
& ......
ÔÚÈí¼þ¿ª·¢ÖУ¬°ÑÊý¾Ý´ÓÒ»¸öµØ·½¸´ÖƵ½ÁíÒ»¸öµØ·½ÊÇÒ»¸öÆÕ±éµÄÓ¦Óá£
Ôںܶ಻ͬµÄ³¡ºÏ¶¼»áÖ´ÐÐÕâ¸ö²Ù×÷£¬°üÀ¨¾Éϵͳµ½ÐÂϵͳµÄÒÆÖ²£¬´Ó²»Í¬µÄÊý¾Ý¿â±¸·ÝÊý¾ÝºÍÊÕ¼¯Êý¾Ý¡£ ASP.NET
2.0ÓÐÒ»¸öSqlBulkCopyÀ࣬Ëü¿ÉÒÔ°ïÖúÄã´Ó²»Í¬µÄÊý¾ÝÔ´¸´ÖÆÊý¾Ýµ½SQL SERVERÊý¾Ý¿â¡£
±¾ÎÄÖÐÎÒ½«Ê¾·¶SqlBulkCopyÀàµÄ²»Í¬Ó¦Óá£
Êý¾Ý¿âÉè ......
1. ´ò¿ªÐµĴ°¿Ú²¢´«ËͲÎÊý£º
¡¡¡¡´«ËͲÎÊý£º
response.write("£¼script£¾window.open(’*.aspx?id="+this.DropDownList1.SelectIndex+"&id1="+...+"’)£¼/script£¾")
¡¡¡¡½ÓÊÕ²ÎÊý£º
string a = Request.QueryString("id");
string b = Request.QueryString("id1");
¡¡¡¡2.Ϊ°´Å¥Ìí¼Ó¶Ô»°¿ò
Button1 ......
using System;
using System.Data;
using System.Configuration;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;
using Syste ......