我要选择checkbox实现多文件下载。不知道怎么实现。

解决方案 »

  1.   

    windows.open("file1");
    windows.open("file2");
    ......
    windows.open("filen");
      

  2.   

    也可以调用迅雷的 方法 
    set ThunderAgent = CreateObject("ThunderAgent.Agent.1")call ThunderAgent.AddTask4()call ThunderAgent.CommitTasks2(1)
      

  3.   

    楼上的,我要选择多个文件,一次性打包下载下来。
    网上有什么WebClient方法不知道行不行。我点击单个文件可以下载,用的代码是这样的。
    FileStream myFile = new FileStream(_fullPath, FileMode.Open, FileAccess.Read, FileShare.ReadWrite);
                BinaryReader br = new BinaryReader(myFile);
                try
                {
                    _Response.AddHeader("Accept-Ranges", "bytes");
                    _Response.Buffer = false;
                    long fileLength = myFile.Length;
                    long startBytes = 0;                int pack = 10240; //10K bytes
                    //int sleep = 200;   //每秒5次   即5*10K bytes每秒
                    int sleep = (int)Math.Floor((decimal)(1000 * pack / _speed)) + 1;
                    if (_Request.Headers["Range"] != null)
                    {
                        _Response.StatusCode = 206;
                        string[] range = _Request.Headers["Range"].Split(new char[] { '=', '-' });
                        startBytes = Convert.ToInt64(range[1]);
                    }
                    _Response.AddHeader("Content-Length", (fileLength - startBytes).ToString());
                    if (startBytes != 0)
                    {
                        _Response.AddHeader("Content-Range", string.Format(" bytes {0}-{1}/{2}", startBytes, fileLength - 1, fileLength));
                    }
                    _Response.AddHeader("Connection", "Keep-Alive");
                    _Response.ContentType = "application/octet-stream";
                    _Response.AddHeader("Content-Disposition", "attachment;filename=" + HttpUtility.UrlEncode(_fileName, System.Text.Encoding.UTF8));                br.BaseStream.Seek(startBytes, SeekOrigin.Begin);
                    int maxCount = (int)Math.Floor((decimal)((fileLength - startBytes) / pack)) + 1;                for (int i = 0; i < maxCount; i++)
                    {
                        if (_Response.IsClientConnected)
                        {
                            _Response.BinaryWrite(br.ReadBytes(pack));
                            Thread.Sleep(sleep);
                        }
                        else
                        {
                            i = maxCount;
                        }
                    }
      

  4.   

    一次性打包下载是要先在服务器端打包的, 一般使用winrar
    然后重定向 
      

  5.   

    可以使用一个叫ICSharpCode.SharpZipLib.dll的组件。思路就是:
    1.将多个要下载的文件添加到一个压缩包里,
    2.将生成的压缩包下载到客户端。
      

  6.   

    我的来推荐一个在线课程试听http://www.cdlanhai.com/zxst/
      

  7.   

    搞定了,我用ICSharpCode.SharpZipLib.dll,方法大家网络搜下就有。