在网站上提供一些文件下载,让访问者选择要下载的文件后,再打包成一个文件一次下载。怎么用ASP.NET实现?

解决方案 »

  1.   

    用ASP.net实现RAR动态压缩文件看行不?
      

  2.   

    你是说用RAR命令行调用?但人家的服务器给你运行Dos命令吗?我看不行吧!
      

  3.   

    给你个网址你自己看看吧!http://www.hackhome.com/InfoView/Article_157425.html C#后端服务器实现
      

  4.   

    谢谢,我试试,不过还是调用Dos命令执行的:
       the_StartInfo = new ProcessStartInfo(); 
       the_StartInfo.FileName = the_rar; 
       the_StartInfo.Arguments = the_Info; 
       the_StartInfo.WindowStyle = ProcessWindowStyle.Hidden; 
       the_Process = new Process(); 
       the_Process.StartInfo = the_StartInfo; 
       the_Process.Start(); 
    只是窗口隐藏了。
      

  5.   


    private void RAR()
    {
    // 把WinRAR目录复制到网站目录下。对WinRAR目录要有运行权限。
    string pathRoot = Server.MapPath("/");
    string winRAR = pathRoot + "WinRAR/WinRAR.exe"; // 把Job.aspx和Default.aspx这两个文件添加到压缩包Job.rar中
    string arguments = @"a Job.rar Job.aspx Default.aspx";

    try
    {
    ProcessStartInfo info = new ProcessStartInfo();
    info.FileName = winRAR; // WinRaR.exe目录
    info.Arguments = arguments; // 参数
    info.WorkingDirectory = pathRoot; Process  p = new  Process();
    p.StartInfo = info;
    p.Start();//启动 Response.Write("压缩成功。");
    }
    catch (Exception ex)
    {
    Response.Write(ex.Message);
    }
    }
      

  6.   

    private void RAR()
    {
        // 把WinRAR目录复制到网站目录下。对WinRAR目录要有运行权限。
        string pathRoot = Server.MapPath("/");
        string winRAR = pathRoot + "WinRAR/WinRAR.exe";    // 把Job.aspx和Default.aspx这两个文件添加到压缩包Job.rar中
        string arguments = @"a Job.rar Job.aspx Default.aspx";
        
        try
        {
            ProcessStartInfo info = new ProcessStartInfo();
            info.FileName = winRAR; // WinRaR.exe目录
            info.Arguments = arguments; // 参数
            info.WorkingDirectory = pathRoot;        Process  p = new  Process();
            p.StartInfo = info;
            p.Start();//启动        Response.Write("压缩成功。");
        }
        catch (Exception ex)
        {
            Response.Write(ex.Message);
        }
    }这个好像还可以,我试过了。