我需要以编程方式将zip归档文件解压到Windows Mobile上的文件夹。是否有易于使用的API可供直接使用,还是应该使用某些外部库?
我需要以编程方式将zip归档文件解压到Windows Mobile上的文件夹。是否有易于使用的API可供直接使用,还是应该使用某些外部库?
private void UnzipSelectedFile()
{
string parent = System.IO.Path.GetDirectoryName(_selectedpath);
string dir = System.IO.Path.Combine(parent,
System.IO.Path.GetFileNameWithoutExtension(_selectedpath));
try
{
using (var zip1 = new Ionic.Zip.ZipFile(_selectedpath))
{
foreach (var entry in zip1)
{
entry.Extract(dir, true);
}
}
// re-populate the treeview with the extracted files:
AddChildren(tvFolders.SelectedNode.Parent);
}
catch (Exception ex)
{
MessageBox.Show("Exception! " + ex);
}
}
我们目前没有计划为WinCE移植Zip。我们希望最终能够完成这个任务,但只有在时间允许的情况下才会进行,而且已经搁置了超过8年(!)。不要抱太大希望,好吗?
- The1nk