Zip And Unzip files and folders

走远了吗. 提交于 2019-12-23 15:22:06

问题


I need to zip and unzip the directory hirarchy in Windows Mobile using C++/C#. What is the simplest library available for it?

I have googled many times. I found some stuff, but I am not able to go ahead with it.

If you have implemented or if you know some stuff about it please let me know.


回答1:


For .NET, SharpZipLib.

See also: Zip library options for the Compact Framework?




回答2:


DotNetZip is a .NET library, has a build for .NET CF.

There's a .NET CF sample application delivered with the devkit. It is a CF app that unzips files on the device.

The code that does the unzipping looks like this:

using (var zip1 = Ionic.Zip.ZipFile.Read(_selectedpath))
{
    foreach (var entry in zip1)
    {
        entry.Extract(dir, ExtractExistingFileAction.OverwriteSilently);
    }
}

// now, re-populate the treeview with the extracted files:
AddChildren(tvFolders.SelectedNode.Parent);


来源:https://stackoverflow.com/questions/1706401/zip-and-unzip-files-and-folders

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!