惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

酷 壳 – CoolShell
酷 壳 – CoolShell
H
Hacker News: Front Page
P
Palo Alto Networks Blog
T
ThreatConnect
Apple Machine Learning Research
Apple Machine Learning Research
博客园_首页
T
True Tiger Recordings
P
Privacy & Cybersecurity Law Blog
B
Blog
IT之家
IT之家
Last Week in AI
Last Week in AI
F
Full Disclosure
Hacker News: Ask HN
Hacker News: Ask HN
C
Comments on: Blog
Microsoft Azure Blog
Microsoft Azure Blog
C
Cybersecurity and Infrastructure Security Agency CISA
Microsoft Security Blog
Microsoft Security Blog
博客园 - 【当耐特】
N
News and Events Feed by Topic
NISL@THU
NISL@THU
腾讯CDC
雷峰网
雷峰网
Security Latest
Security Latest
李成银的技术随笔
M
Microsoft Research Blog - Microsoft Research
L
LangChain Blog
L
Lohrmann on Cybersecurity
cs.CL updates on arXiv.org
cs.CL updates on arXiv.org
C
Check Point Blog
Y
Y Combinator Blog
Recent Announcements
Recent Announcements
博客园 - Franky
N
News | PayPal Newsroom
V
V2EX
A
About on SuperTechFans
The Register - Security
The Register - Security
月光博客
月光博客
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
Google Online Security Blog
Google Online Security Blog
MyScale Blog
MyScale Blog
Cisco Talos Blog
Cisco Talos Blog
Vercel News
Vercel News
WordPress大学
WordPress大学
C
Cyber Attacks, Cyber Crime and Cyber Security
The Hacker News
The Hacker News
IntelliJ IDEA : IntelliJ IDEA – the Leading IDE for Professional Development in Java and Kotlin | The JetBrains Blog
IntelliJ IDEA : IntelliJ IDEA – the Leading IDE for Professional Development in Java and Kotlin | The JetBrains Blog
爱范儿
爱范儿
A
Arctic Wolf
L
LINUX DO - 最新话题
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More

博客园 - David

最近比较烦 网络安全管理---三分技术加上七分管理 DataGrid点击删除按钮弹出确认对话框一个好办法 asp.net常用函数 Container.DataItem几种方式. 再贴一个菜单的例子 菜单或浮动窗口被Select等对象遮盖的解决方案 使用缓存时候,发现Page_load只能运行一次的解决方法。 对URL中的参数验证,防止用户恶意改变差数值。 - David 常见木马端口 超时时间已到。在操作完成之前超时时间已过 令人苦笑的诺顿防火墙 IIS5 中内部错误解决方法 正则表达式学习 公司文件服务器管理,让用户快速找到需要的文件。 域名相关知识 字节换算关系 Sql2000中DateName的使用来获取年和月。 对下拉控件的绑定
Asp.net上传文件限制,在大于5M的时候出现DNS解析错误,解决方法。
David · 2004-12-16 · via 博客园 - David

在利用
private void Upload_Click(object sender, System.EventArgs e)
  {
   if(this.File1.PostedFile.ContentLength != 0 && this.File1.PostedFile.ContentLength < (50*1024*1024))
   {

              string strUploadFold = "/upload/";
    string strFileName = this.File1.PostedFile.FileName;
    int intPosition = strFileName.LastIndexOf("\\");
    strFileName = strFileName.Substring(intPosition+1);
    string strSavePosition = Request.MapPath(strUploadFold)+strFileName;
    this.File1.PostedFile.SaveAs(strSavePosition);
    this.Infor1.Text = this.File1.PostedFile.ContentLength+" = "+this.File1.PostedFile.ContentLength/(1024*1024)+"M";

   }
   else
   {
    this.Infor1.Text = "上传的文件的大小超出范围!";
   }

     }
  上传文件的时候,发现如果文件超过了5M就不能上传成功。
解决方法:在<system.web>中加入
<httpRuntime maxRequestLength="10240" /> 这个是控制指示 ASP.NET 支持的最大文件上载大小。该限制可用于防止因用户将大量文件传递到该服务器而导致的拒绝服务攻击。指定的大小以 KB 为单位。默认值为 4096 KB (4 MB)。