﻿<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/"><channel><title>博客园-高山来客-最新评论</title><link>http://www.cnblogs.com/bashan/CommentsRSS.aspx</link><description /><language>zh-cn</language><pubDate>Thu, 29 May 2008 05:34:10 GMT</pubDate><lastBuildDate>Thu, 29 May 2008 05:34:10 GMT</lastBuildDate><generator>cnblogs</generator><item><title>re: Asp.NET大文件上传组件开发总结_NET2.0源码下载。</title><link>http://www.cnblogs.com/bashan/archive/2008/05/29/1206097.html#1212618</link><dc:creator>fqmail</dc:creator><author>fqmail</author><pubDate>Thu, 29 May 2008 03:44:09 GMT</pubDate><guid>http://www.cnblogs.com/bashan/archive/2008/05/29/1206097.html#1212618</guid><description><![CDATA[编译运行成功，首页js报错：document.all.UploadID.value 为空或不是对象<br>然后直接：Internet Explorer 无法显示该网页<br><br>测试环境：win2003 vs2005sp1 ie7.0<br><br><div align=right><a style="text-decoration:none;" href="http://bashan.cnblogs.com/" target="_blank">fqmail</a> 2008-05-29 11:44 <a href="http://www.cnblogs.com/bashan/archive/2008/05/29/1206097.html#1212618#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>re: Asp.NET大文件上传组件开发总结_NET2.0源码下载。</title><link>http://www.cnblogs.com/bashan/archive/2008/05/28/1206097.html#1212037</link><dc:creator>巴山</dc:creator><author>巴山</author><pubDate>Wed, 28 May 2008 12:04:11 GMT</pubDate><guid>http://www.cnblogs.com/bashan/archive/2008/05/28/1206097.html#1212037</guid><description><![CDATA[.@marxTen<br>对大文件大小超过指定大小时,如果用户要显示自定义错误,而又简单的避免Asp.NET显的错误,可以在封装数据时,不保存临时文件,然后,将多余的文件内容去掉后返回给页面,在返回前,可以用如下方式在缓存中加一个变量.<br>HttpContext.Current.Cache.Add(context.GUID, context, null, DateTime.Now.AddDays(10), TimeSpan.Zero, CacheItemPriority.High, null);<br>这样你就可以在页面中处理这个错误了.<br><br>不过,这样虽然处理了自定义错误,但没有改变客户端上传的内容,所以也没有节约到资源,因为如果你提前断开连接,那客户端就不能接收到响.<br>你可以试试<br><br><div align=right><a style="text-decoration:none;" href="http://bashan.cnblogs.com/" target="_blank">巴山</a> 2008-05-28 20:04 <a href="http://www.cnblogs.com/bashan/archive/2008/05/28/1206097.html#1212037#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>re: Asp.NET大文件上传组件开发总结_NET2.0源码下载。</title><link>http://www.cnblogs.com/bashan/archive/2008/05/28/1206097.html#1212034</link><dc:creator>巴山</dc:creator><author>巴山</author><pubDate>Wed, 28 May 2008 11:58:06 GMT</pubDate><guid>http://www.cnblogs.com/bashan/archive/2008/05/28/1206097.html#1212034</guid><description><![CDATA[--引用--------------------------------------------------<br>hxling: 程序楼主没有测试好吧！上传几十M的文件就出错<br>--------------------------------------------------------<br>对不起了啊!是一个测试语句没有去掉啊!!<br>应当把<br>if (!IsUploadRequest(app.Request)) return; //不是文件上传，则退出 <br>return; <br>这后面的这个return 去掉.<br>--引用--------------------------------------------------<br>marxTen: 在IIS里面测试了下，发现点击上传按钮以后，弹出了进度条页面，然后进度条页面就消失了，文件也没有上传～<br>不知道博主测试的时候有没有遇到这样的问题，我是xp+vs2005sp1~<br>--------------------------------------------------------<br>我测试时,进度窗口必须要手工关闭呢?<br><br><br><div align=right><a style="text-decoration:none;" href="http://bashan.cnblogs.com/" target="_blank">巴山</a> 2008-05-28 19:58 <a href="http://www.cnblogs.com/bashan/archive/2008/05/28/1206097.html#1212034#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>re: 在地震中乱谈</title><link>http://www.cnblogs.com/bashan/archive/2008/05/28/1201370.html#1212030</link><dc:creator>巴山</dc:creator><author>巴山</author><pubDate>Wed, 28 May 2008 11:55:54 GMT</pubDate><guid>http://www.cnblogs.com/bashan/archive/2008/05/28/1201370.html#1212030</guid><description><![CDATA[我把错改了,谢谢了哟.<br><br><div align=right><a style="text-decoration:none;" href="http://bashan.cnblogs.com/" target="_blank">巴山</a> 2008-05-28 19:55 <a href="http://www.cnblogs.com/bashan/archive/2008/05/28/1201370.html#1212030#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>re: Asp.NET大文件上传组件开发总结(六)---大文件上传组件使用说明</title><link>http://www.cnblogs.com/bashan/archive/2008/05/28/1206095.html#1212027</link><dc:creator>巴山</dc:creator><author>巴山</author><pubDate>Wed, 28 May 2008 11:51:19 GMT</pubDate><guid>http://www.cnblogs.com/bashan/archive/2008/05/28/1206095.html#1212027</guid><description><![CDATA[--引用--------------------------------------------------<br>marxTen: 有.NET 2.0的源代码吗？如果有请发给我一份，ftkhunter@yahoo.com.cn谢谢了～<br>最近也在做大文件上传的组件～想参考下博主的程序。<br>--------------------------------------------------------<br><br>源码自己下三,你还没找到啊?在我第六篇不是专门提供了下载吗?<br><br><br><div align=right><a style="text-decoration:none;" href="http://bashan.cnblogs.com/" target="_blank">巴山</a> 2008-05-28 19:51 <a href="http://www.cnblogs.com/bashan/archive/2008/05/28/1206095.html#1212027#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>re: Asp.NET大文件上传组件开发总结_NET2.0源码下载。</title><link>http://www.cnblogs.com/bashan/archive/2008/05/28/1206097.html#1211883</link><dc:creator>hxling</dc:creator><author>hxling</author><pubDate>Wed, 28 May 2008 08:58:58 GMT</pubDate><guid>http://www.cnblogs.com/bashan/archive/2008/05/28/1206097.html#1211883</guid><description><![CDATA[程序楼主没有测试好吧！上传几十M的文件就出错<br><br><div align=right><a style="text-decoration:none;" href="http://bashan.cnblogs.com/" target="_blank">hxling</a> 2008-05-28 16:58 <a href="http://www.cnblogs.com/bashan/archive/2008/05/28/1206097.html#1211883#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>re: Asp.NET大文件上传组件开发总结_NET2.0源码下载。</title><link>http://www.cnblogs.com/bashan/archive/2008/05/28/1206097.html#1211485</link><dc:creator>marxTen</dc:creator><author>marxTen</author><pubDate>Wed, 28 May 2008 03:41:50 GMT</pubDate><guid>http://www.cnblogs.com/bashan/archive/2008/05/28/1206097.html#1211485</guid><description><![CDATA[在IIS里面测试了下，发现点击上传按钮以后，弹出了进度条页面，然后进度条页面就消失了，文件也没有上传～<br>不知道博主测试的时候有没有遇到这样的问题，我是xp+vs2005sp1~<br><br><div align=right><a style="text-decoration:none;" href="http://bashan.cnblogs.com/" target="_blank">marxTen</a> 2008-05-28 11:41 <a href="http://www.cnblogs.com/bashan/archive/2008/05/28/1206097.html#1211485#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>re: 可以在没有安装Office的情况，使用.net代码操作Excel文件的代码</title><link>http://www.cnblogs.com/bashan/archive/2008/05/28/1192678.html#1211462</link><dc:creator>丁香</dc:creator><author>丁香</author><pubDate>Wed, 28 May 2008 03:27:26 GMT</pubDate><guid>http://www.cnblogs.com/bashan/archive/2008/05/28/1192678.html#1211462</guid><description><![CDATA[wind-23-fengfeng@163.com 辛苦了，多谢~<br><br><div align=right><a style="text-decoration:none;" href="http://bashan.cnblogs.com/" target="_blank">丁香</a> 2008-05-28 11:27 <a href="http://www.cnblogs.com/bashan/archive/2008/05/28/1192678.html#1211462#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>re: Asp.NET大文件上传组件开发总结_NET2.0源码下载。</title><link>http://www.cnblogs.com/bashan/archive/2008/05/28/1206097.html#1211394</link><dc:creator>marxTen</dc:creator><author>marxTen</author><pubDate>Wed, 28 May 2008 02:38:18 GMT</pubDate><guid>http://www.cnblogs.com/bashan/archive/2008/05/28/1206097.html#1211394</guid><description><![CDATA[呵呵，刚看到原来博主发了源码～<br>下了看了下，有一个问题～<br> private void context_BeginRequest(object sender, EventArgs e)<br>        {<br>            <br>            HttpApplication app = sender as HttpApplication;<br>            HttpWorkerRequest request = GetWorkerRequest(app.Context);<br>            <br>            if (!IsUploadRequest(app.Request)) return; //不是文件上传，则退出<br>            return;<br>为什么要再return下？<br>还有，我通过cookie，把自定义错误返回，比如：文件类型错误，大小错误～<br>因为在application_beginrequest里面，页面逻辑还没有进行处理，SESSION什么的都为NULL，所以我用下面的方法：<br>if (m_totalRequsetSize &lt; this.User_MaxSize)<br>                {<br>                    if (m_totalRequsetSize &gt; this.m_uploadInstance.m_MaxSize)<br>                    {<br>                        HttpCookie addMusicCookie = new HttpCookie(&quot;addMusicResult&quot;);<br>                        addMusicCookie[&quot;addMusicResult&quot;] = &quot;2&quot;;<br>                        addMusicCookie.Path = &quot;/user/music/&quot;;<br>                        addMusicCookie.Expires = DateTime.Now.AddHours(2);<br>                        HttpContext.Current.Response.Cookies.Add(addMusicCookie);<br>                        return;<br>                        //throw new Exception(&quot;Out of upload file size.&quot;);<br>                        //HttpContext.Current.Response.Write(&quot;&lt;script&gt;alert('文件超过默认上传大小5M～')&lt;/script&gt;&quot;);<br><br>                    }<br>                }<br>                else<br>                {<br>                    try<br>                    {<br>                        HttpCookie addMusicCookie = new HttpCookie(&quot;addMusicResult&quot;);<br>                        addMusicCookie[&quot;addMusicResult&quot;] = &quot;0&quot;;<br>                        addMusicCookie.Path = &quot;/user/music/&quot;;<br>                        addMusicCookie.Expires = DateTime.Now.AddHours(2);<br>                        HttpContext.Current.Response.Cookies.Add(addMusicCookie);<br>                        return;<br>                    }<br>                    catch<br>                    {<br>                        return;<br>                    }<br>                    //HttpContext.Current.Request.QueryString.Add(&quot;r&quot;, &quot;0&quot;);<br>                    //return;<br>                }<br>返回自定义错误。<br>然后再页面上通过读取cookie来弹出错误，并且同时还需要删除掉这个cookie～<br>不知道博主有没有比较好的办法～<br><br>另外，源程序里面的Default.aspx中无法找到window.showModelessDialog('ProgressBar.aspx?UploadID='+document.all.UploadID.value,window,'status:no;dialogWidth:500px;dialogHeight:250px;center:yes;help:no;');<br>里面的document.all.UploadID.value,发现你页面上也没有定义～<br><br><div align=right><a style="text-decoration:none;" href="http://bashan.cnblogs.com/" target="_blank">marxTen</a> 2008-05-28 10:38 <a href="http://www.cnblogs.com/bashan/archive/2008/05/28/1206097.html#1211394#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>re: Asp.NET大文件上传组件开发总结(六)---大文件上传组件使用说明</title><link>http://www.cnblogs.com/bashan/archive/2008/05/28/1206095.html#1211355</link><dc:creator>marxTen</dc:creator><author>marxTen</author><pubDate>Wed, 28 May 2008 02:12:01 GMT</pubDate><guid>http://www.cnblogs.com/bashan/archive/2008/05/28/1206095.html#1211355</guid><description><![CDATA[有.NET 2.0的源代码吗？如果有请发给我一份，ftkhunter@yahoo.com.cn谢谢了～<br>最近也在做大文件上传的组件～想参考下博主的程序。<br><br><div align=right><a style="text-decoration:none;" href="http://bashan.cnblogs.com/" target="_blank">marxTen</a> 2008-05-28 10:12 <a href="http://www.cnblogs.com/bashan/archive/2008/05/28/1206095.html#1211355#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item></channel></rss>