在以文件服务器上有多个文件(文件个数不定),点击下载按钮,多个文件一起Response到客户端,显示打开保存对话框(如果能不显示对话框直接写到客户机的硬盘上更好),并别要求:能够知道客户端文件什么时候下载完毕。
请高人指教!!!!
现在如果用Response方法,那么只能下载一个文件,而且不知道文件什么时候下载完毕。(文件全都是.txt格式)
现在没什么好的思路 请各位帮忙想想好办法!!!!
15 个解决方案
#1
up
#2
多文件打包下载
http://topic.csdn.net/u/20091023/15/d7f724a6-1396-4940-9fa1-a24542f2025d.html
或
const string filePath = @"";
const string url = "";
try
{
using (WebClient wc = new WebClient())
{
string html = wc.DownloadString(url);
using (StreamWriter writer = new StreamWriter(filePath,false,wc.Encoding))
{
writer.Write(html);
writer.Flush();
}
}
}
catch (Exception ex)
{
Console.WriteLine(ex.Message);
}
Console.Read();
还可使用多线程
显示下载进度条
http://topic.csdn.net/u/20091023/15/d7f724a6-1396-4940-9fa1-a24542f2025d.html
或
const string filePath = @"";
const string url = "";
try
{
using (WebClient wc = new WebClient())
{
string html = wc.DownloadString(url);
using (StreamWriter writer = new StreamWriter(filePath,false,wc.Encoding))
{
writer.Write(html);
writer.Flush();
}
}
}
catch (Exception ex)
{
Console.WriteLine(ex.Message);
}
Console.Read();
还可使用多线程
显示下载进度条
#3
帮顶了,学习可!
#4
帮顶了,学习中!
#5
人生如梦 :
我的是要求多个文件不可以压缩。还有 怎么用多线程察看下载进度,能再说的详细点吗??
万分感谢!
#6
up
#7
response到客户端?
你这里一个文件能够实现 ,能用遍历不? 传完一个再传第二个?
response传文件。。。是B/S的吗?
你这里一个文件能够实现 ,能用遍历不? 传完一个再传第二个?
response传文件。。。是B/S的吗?
#8
打包上传下载:
ICSharpCode.SharpZipLib
http://www.webjishu.cn//htm/2009112/170.htm
ICSharpCode.SharpZipLib
http://www.webjishu.cn//htm/2009112/170.htm
#9
拜托各位 要求是不能压缩的!!!! 多个文件 怎么一起(或者循环)下载到客户端?????
#10
还有 我是要从服务器端 下载的 客户机上 ,不是从文件服务器下载到WEB服务器!!!!!
期待高人!!!!
期待高人!!!!
#11
即然是文本文件,直接输出到客户端不就完事了,直接显示在浏览器里,
多个文件就调用多个窗口来分别显示,
文件内容不是太大的话就使用js控制.
多个文件就调用多个窗口来分别显示,
文件内容不是太大的话就使用js控制.
#12
不行的 要求必须提示下载 不能直接打开。
#13
每个文件用一个iframe,这样会弹出多个下载框
弹出一个下载框,下载多个文件,貌似不行吧,没弄过
弹出一个下载框,下载多个文件,貌似不行吧,没弄过
#14
大家再帮帮忙啊 问题解决 马上结贴!!!!!!!!!!!!!
#15
恩 就是想弹出多个下载框,文件个数不定
#1
up
#2
多文件打包下载
http://topic.csdn.net/u/20091023/15/d7f724a6-1396-4940-9fa1-a24542f2025d.html
或
const string filePath = @"";
const string url = "";
try
{
using (WebClient wc = new WebClient())
{
string html = wc.DownloadString(url);
using (StreamWriter writer = new StreamWriter(filePath,false,wc.Encoding))
{
writer.Write(html);
writer.Flush();
}
}
}
catch (Exception ex)
{
Console.WriteLine(ex.Message);
}
Console.Read();
还可使用多线程
显示下载进度条
http://topic.csdn.net/u/20091023/15/d7f724a6-1396-4940-9fa1-a24542f2025d.html
或
const string filePath = @"";
const string url = "";
try
{
using (WebClient wc = new WebClient())
{
string html = wc.DownloadString(url);
using (StreamWriter writer = new StreamWriter(filePath,false,wc.Encoding))
{
writer.Write(html);
writer.Flush();
}
}
}
catch (Exception ex)
{
Console.WriteLine(ex.Message);
}
Console.Read();
还可使用多线程
显示下载进度条
#3
帮顶了,学习可!
#4
帮顶了,学习中!
#5
人生如梦 :
我的是要求多个文件不可以压缩。还有 怎么用多线程察看下载进度,能再说的详细点吗??
万分感谢!
#6
up
#7
response到客户端?
你这里一个文件能够实现 ,能用遍历不? 传完一个再传第二个?
response传文件。。。是B/S的吗?
你这里一个文件能够实现 ,能用遍历不? 传完一个再传第二个?
response传文件。。。是B/S的吗?
#8
打包上传下载:
ICSharpCode.SharpZipLib
http://www.webjishu.cn//htm/2009112/170.htm
ICSharpCode.SharpZipLib
http://www.webjishu.cn//htm/2009112/170.htm
#9
拜托各位 要求是不能压缩的!!!! 多个文件 怎么一起(或者循环)下载到客户端?????
#10
还有 我是要从服务器端 下载的 客户机上 ,不是从文件服务器下载到WEB服务器!!!!!
期待高人!!!!
期待高人!!!!
#11
即然是文本文件,直接输出到客户端不就完事了,直接显示在浏览器里,
多个文件就调用多个窗口来分别显示,
文件内容不是太大的话就使用js控制.
多个文件就调用多个窗口来分别显示,
文件内容不是太大的话就使用js控制.
#12
不行的 要求必须提示下载 不能直接打开。
#13
每个文件用一个iframe,这样会弹出多个下载框
弹出一个下载框,下载多个文件,貌似不行吧,没弄过
弹出一个下载框,下载多个文件,貌似不行吧,没弄过
#14
大家再帮帮忙啊 问题解决 马上结贴!!!!!!!!!!!!!
#15
恩 就是想弹出多个下载框,文件个数不定