如何使用DotNetZip库

时间:2013-03-01 13:46:19

标签: asp.net-mvc-3 dotnetzip

我解压缩了我下载的文件。如何以及在我的asp.net mvc 3应用程序中访问哪些库,以便能够解压缩包含多个文件的文件?

我的控制器代码:

 public ActionResult Upload(ScormUploadViewModel model)
{
  if (ModelState.IsValid)
  {
    if (model.ScormPackageFile != null)
    {
      string zipCurFile = model.ScormPackageFile.FileName;
      string fullPath = Path.GetDirectoryName(zipCurFile);
      string directoryName = Path.GetFileNameWithoutExtension(zipCurFile);
      Directory.CreateDirectory(Path.Combine(fullPath, directoryName));

      using (FileStream zipFile = new FileStream(zipCurFile, FileMode.Open))
      {
        using (GZipStream zipStream = new GZipStream(zipFile, CompressionMode.Decompress))
        {
          StreamReader reader = new StreamReader(zipStream);  
         //next unzip the file? how to get the library i need?
        }
      }

感谢

0 个答案:

没有答案