如何在vs 2008中压缩文件 [英] How to zip files in vs 2008

查看:155
本文介绍了如何在vs 2008中压缩文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要使用.net framework 3.5在vb.net中压缩一些文件。

我们如何实现这个目标?

I require to zip some files in vb.net using .net framework 3.5.
how we can achieve this?

推荐答案

使用 SharpZipLib [ ^ ] - 谷歌会找到大量的说明和示例。
Use SharpZipLib[^] - google will find you plenty of instructions and examples.


试试这个..





Try this..


private string[] ExpandZipFile(string ZipFile, string DestFolder)  
    {  
      Shell h = new Shell();  
      Folder sf = h.NameSpace(ZipFile);  
      Folder df = h.NameSpace(DestFolder);  
      string[] files = new string[sf.Items().Count];  
      int i = 0;  
      foreach (FolderItem f in sf.Items())  
      {  
        df.CopyHere(f, 0);  
        files[i++] = f.Name;  
      }  
      return files;  
    }


这篇关于如何在vs 2008中压缩文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆