本文整理汇总了C#中Ionic.Zip.ZipFile.GetEnumerator方法的典型用法代码示例。如果您正苦于以下问题:C# ZipFile.GetEnumerator方法的具体用法?C# ZipFile.GetEnumerator怎么用?C# ZipFile.GetEnumerator使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Ionic.Zip.ZipFile
的用法示例。
在下文中一共展示了ZipFile.GetEnumerator方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: thread_DoWork
private void thread_DoWork(object sender, DoWorkEventArgs e)
{
if (isDemoProject)
{
string demoZipPath = System.Windows.Forms.Application.StartupPath + @"\APIDemo.lmg";
if (File.Exists(demoZipPath))
{
ZipFile zip = new ZipFile(demoZipPath);
if (Directory.Exists(dstPath + @"\APIDemo"))
{
createResult = false;
return;
}
IEnumerator<ZipEntry> entries = zip.GetEnumerator();
maxFileCount = 0;
while (entries.MoveNext())
{
ZipEntry entry = entries.Current;
maxFileCount++;
}
entries = zip.GetEnumerator();
currentFileCount = 0;
while (entries.MoveNext())
{
ZipEntry entry = entries.Current;
entry.Extract(dstPath, ExtractExistingFileAction.OverwriteSilently);
pd.UpdateProgress((double)(++currentFileCount) / (double)maxFileCount);
pd.UpdateStatus(entry.FileName);
}
}
else
{
createResult = false;
}
}
else
{
maxFileCount = fileCount(srcPath);
currentFileCount = 0;
Thread.Sleep(100);
//dstPath += @"\" + projectName;
if (Directory.Exists(dstPath))
{
createResult = false;
return;
}
copyAll(srcPath, dstPath);
if (isLandscape)
File.Delete(dstPath + @"\assets\main_portrait.lua");
else
{
File.Delete(dstPath + @"\assets\main.lua");
File.Move(dstPath + @"\assets\main_portrait.lua", dstPath + @"\assets\main.lua");
}
createProjectInformationFile();
}
}
示例2: Initialise
private void Initialise(Stream zipStream)
{
try
{
zipFile = ZipFile.Read(zipStream);
}
catch (ZipException e)
{
throw new ArgumentException("Cannot read input as a ZipFile", "zipStream", e);
}
enumerator = zipFile.GetEnumerator();
zipFile.ExtractProgress += zipFile_ExtractProgress;
}