我有一个图片调整大小和图片缩略图工作正常的代码,但它只支持 3MB 的最大文件大小。我想将文件大小限制增加到至少 10 到 12MB。任何人都可以为我做吗?谢谢
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)
{
}
protected void Upload_Click(object sender, EventArgs e)
{
if (FileUpload1.HasFile)
{
FileUpload1.SaveAs(MapPath("Image/" + FileUpload1.FileName));
System.Drawing.Image img1 = System.Drawing.Image.FromFile(MapPath("image/") + FileUpload1.FileName);
System.Drawing.Image bmp1 = img1.GetThumbnailImage(50, 50, null, IntPtr.Zero);
bmp1.Save(MapPath("thumbnail/S/") + FileUpload1.FileName);
System.Drawing.Image bmp2 = img1.GetThumbnailImage(100, 100, null, IntPtr.Zero);
bmp2.Save(MapPath("thumbnail/L/") + FileUpload1.FileName);
NormalImage.ImageUrl = "Image/" + FileUpload1.FileName;
ThumbnailImageS.ImageUrl = "thumbnail/S/" + FileUpload1.FileName;
ThumbnailImageM.ImageUrl = "thumbnail/L/" + FileUpload1.FileName;
}
}