Ò׽ؽØÍ¼Èí¼þ¡¢µ¥Îļþ¡¢Ãâ°²×°¡¢´¿ÂÌÉ«¡¢½ö160KB
ÈÈÃűêÇ©£º c c# c++ asp asp.net linux php jsp java vb Python Ruby mysql sql access Sqlite sqlserver delphi javascript Oracle ajax wap mssql html css flash flex dreamweaver xml
 ×îÐÂÎÄÕ :

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 =&nb ......

asp.netÒ³ÃæÉúÃüÖÜÆÚ ¸÷ʱÆÚʼþ

using System;
using System.Collections.Specialized;
using System.Data;
using System.Configuration;
using System.Collections;
using System.IO;
using System.Threading;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
namespace WebApplication1
{
public partial class WebForm4 : System.Web.UI.Page
{
private const string INFO_DIR = @"c:\Downloads\";
public static int requestCount;
/// <summary>
///µäÐÍÓ¦ÓãºÊ¹ÓÃIsPostBackÊôÐÔÈ·¶¨ÊÇ·ñÊǵÚÒ»´Î´¦Àí¸ÃÒ³£»
///´´½¨»òÕßÖØÐ´´½¨¶¯Ì¬¿Ø¼þ£»
///¶¯Ì¬ÉèÖÃĸ°æÒ³£»
////¶¯Ì¬ÉèÖÃThemeÊôÐÔ£»
///¶ÁÈ¡»òÕßÉèÖÃÅäÖÃÎļþÊôÐÔÖµ¡£
///×¢Ò⣺Èç¹ûÇëÇóÊǻط¢ÇëÇó£¬Ôò¿Ø¼þµÄÖµÉÐδ´ÓÊÓͼ״̬»¹Ô­¡£Èç¹ûÔڴ˽׶ÎÉèÖÿؼþÊôÐÔ£¬ÔòÖµ¿ÉÄÜ»áÔÚÏÂÒ»½×¶Î±»¸Äд¡£
/// </summary>
/// <param name="sender"></param>
......

ASP.NETÒ³Ãæ¼¶±ðµÄÊÂÎñ

 ASP.NET ÊÂÎñ¿ÉÒÔ˵ÊÇÔÚ.NET ƽ̨ÉÏÊÂÎñʵÏÖ·½Ê½×î¼òµ¥µÄÒ»ÖÖ£¬Äã½ö½öÐèÒªÒ»Ðдú
Âë¼´¿É¡£ÔÚ aspx µÄÒ³ÃæÉùÃ÷ÖмÓÒ»¸ö¶îÍâµÄÊôÐÔ£¬¼´ÊÂÎñÊôÐÔ Transaction="Required"£¬
ËüÓÐÈçϵÄÖµ£ºDisabled£¨Ä¬ÈÏ£©¡¢NotSupported¡¢Supported¡¢Required ºÍ RequiresNew£¬Õâ
ЩÉèÖúÍCOM+¼°ÆóÒµ¼¶·þÎñÖеÄÉèÖÃÒ»Ñù£¬ µäÐ͵ÄÒ»¸öÀý×ÓÊÇÈç¹ûÄãÏëÔÚÒ³ÃæÉÏÏÂÎÄÖÐÔË
ÐÐÊÂÎñ£¬ÄÇôҪ½«ÆäÉèÖÃΪRequired¡£Èç¹ûÒ³ÃæÖаüº¬ÓÐÓû§¿Ø¼þ£¬ÄÇôÕâЩ¿Ø¼þÒ²»á°üº¬
µ½ÊÂÎñÖУ¬ÊÂÎñ»á´æÔÚÓÚÒ³ÃæµÄÿ¸öµØ·½¡£
Ò³ÃæÉùÃ÷Transaction="Required"£º
<%@  Page  Transaction="Required"    Language="C#"  AutoEventWireup="true" 
 CodeBehind="WebForm3.aspx.cs"  Inherits="WebApplication4.WebForm3"  %>
Ò³ÃæÒýÓãºusing System.EnterpriseServices;¡£
È»ºó£¬Êý¾Ý²Ù×÷´úÂ룺
protected  void  Button1_Click(object  sender,  EventArgs  e)
{
        try
        {
        ......

±àÂë¸ñʽҪͳһ£¬Asp.net°ÑUTF

Asp.net°ÑUTF-8±àÂëת»»ÎªGB2312±àÂë
×î½üÔÚ×öµÄϵͳÖУ¬Åöµ½ÁËÒ»¸öÎÊÌ⣬½»Ò×ϵͳ²ÉÓõÄUTF-8±àÂ룬¶øÒ»Ð©Ö§³ÖϵͳʹÓõÄÊÇGB2312±àÂë¡£
²»Í¬±àÂëµÄÒ³Ãæ¡¢½Å±¾Ö®¼ä»¥ÏàÒýÓ㬾ͻá²úÉúÂÒÂëµÄÎÊÌ⣬½â¾ö·½·¨¾ÍÊÇͳһ³ÉÒ»ÖÖ±àÂë¡£
asp.net ÖУ¬Èç¹ûÒªÐÞ¸ÄÊä³öÒ³ÃæµÄ±àÂ룬¿ÉÒÔͨ¹ýÐÞ¸Äweb.configÖÐÒÔÏÂÅäÖÃÐÅÏ¢
<globalization requestEncoding="utf-8" responseEncoding="utf-8" />
ÒÔÉÏÖ»ÊÇÐÞ¸ÄÕûÌåµÄĬÈϱàÂ룬Èç¹ûÖ»ÓÐij¸öÒ³µÄ±àÂëÐèÒªÐ޸ģ¬ASP.net ÖÐÔò¿ÉÒÔ¼òµ¥µÄʹÓÃÏÂÃæ´úÂ룺
×¢:¼Óµ½Page_Load()ʼþÏÂÃæ¾Í¿ÉÒÔÁË
Encoding gb2312 = Encoding.GetEncoding("gb2312");
Response.ContentEncoding = gb2312;
ÔÚ·ÇASP.net Ó¦ÓÃÖУ¬¿ÉÄÜÄã¶Áµ½µÄÊý¾ÝÊÇUTF-8±àÂ룬µ«ÊÇÄãҪת»»ÎªGB2312±àÂ룬Ôò¿ÉÒԲο¼ÒÔÏ´úÂ룺
 
string utfinfo = "document.write(\"alert('ÄãºÃô£¿£¿');\");";
string gb2312info = string.Empty;
Encoding utf8 = Encoding.UTF8;
Encoding gb2312 = Encoding.GetEncoding("gb2312");
// Convert the string into a byte[].
byte[] unicodeBytes = utf8.GetBytes(utfinfo);
// Perform the conversion from one encoding t ......

asp.net Òþ²ØÍ¼Æ¬µÄÕæÊµµØÖ·

 Default.aspx CSÎļþ´úÂë
using System;
using System.Data;
using System.Configuration;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
public partial class _Default : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
if (!Page.IsPostBack)
{
string filename;
filename = Request.QueryString["file"].ToString();
Response.Redirect("Image/"+filename+".jpg");
}
}
}

Default2.aspx
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default2.aspx.cs" Inherits="Default2" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
<title>ÎÞ±êÌâÒ³</title>
</head>
......

ASP.Net ÉÏ´«Í¼Æ¬²¢Éú³É¸ßÇåÎúËõÂÔͼ

<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default2.aspx.cs" Inherits="Default2" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
<title>ÎÞ±êÌâÒ³</title>
</head>
<body>
<form id="form1" runat="server">
<div>
<input id="File1" runat="server" type="file" /></div><asp:Button ID="Button1" runat="server" OnClick="Button1_Click" Text="Button" />
</form>
</body>
</html>
protected void Button1_Click(object sender, EventArgs e)
{
string a = this.UpLoadImage(this.File1, "UpLoad/", "thumb_", 118, 118);
}
/// <summary>
/// asp.netÉÏ´«Í¼Æ¬²¢Éú³ÉËõÂÔͼ
/// </summary>
/// <param name="upImage">HtmlInputFile¿Ø¼þ</param>
/// <param name="sSavePath">±£´æµÄ·¾¶,ЩΪÏà¶Ô·þÎñÆ÷·¾¶µÄϵÄÎ ......
×ܼǼÊý:40319; ×ÜÒ³Êý:6720; ÿҳ6 Ìõ; Ê×Ò³ ÉÏÒ»Ò³ [5342] [5343] [5344] [5345] 5346 [5347] [5348] [5349] [5350] [5351]  ÏÂÒ»Ò³ βҳ
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØÍ¼ | ¸ÓICP±¸09004571ºÅ