本文整理汇总了C#中System.IO.Extract方法的典型用法代码示例。如果您正苦于以下问题:C# IO.Extract方法的具体用法?C# IO.Extract怎么用?C# IO.Extract使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类System.IO
的用法示例。
在下文中一共展示了IO.Extract方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: ExtractAll
public void ExtractAll(sio.FileStream fs, string extrPath)
{
sio.DirectoryInfo di;
int i, j;
if (primary == null)
return;
extrPath = misc.DICreateAndCheck(extrPath).FullName;
for (i = 0; i < paths.Count; i++)
{
di = misc.DICreateAndCheck(extrPath + paths[i].fullName);
for (j = 1; j < paths[i].files.Count; j++)
if (!paths[i].files[j].isDirectory)
{
Console.WriteLine(string.Format("Extracting file '{0}'", paths[i].fullName + paths[i].files[j].name));
fs.Extract(di.FullName + paths[i].files[j].name, (long)paths[i].files[j].hdr.locL * ISO9660.logSize + ISO9660.fsOff, (uint)paths[i].files[j].hdr.datLenL);
}
}
}
示例2: GetArchs
private void GetArchs(string extrPath, string name, sio.MemoryStream ms, long len)
{
sio.BinaryReader br;
int archType;
long prevPos;
long lastPos;
int fileCount;
gIterCount++;
br = new sio.BinaryReader(ms);
prevPos = ms.Position;
lastPos = prevPos + len;
archType = GetArchType(br, len, out fileCount);
if (archType > 0)
if (sw == null)
sw = new sio.StreamWriter(string.Format("{0}{1}$arch.type", extrPath, misc.dirSep));
ms.Position = prevPos;
switch (archType)
{
case 1:
sw.WriteLine("{{type={0},name={1},count={2}}}", archType, name, fileCount);
ExtractUnNamedBinary(extrPath, br, lastPos);
sw.WriteLine("{end}");
break;
case 2:
sw.WriteLine("{{type={0},name={1}}}", archType, name);
ExtractNamedBinary(extrPath, br, len);
sw.WriteLine("{end}");
break;
case 3:
sw.WriteLine("{{type={0},name={1},count={2}}}", archType, name, fileCount);
ExtractSpr0(extrPath, br, lastPos);
sw.WriteLine("{end}");
break;
case 4:
sw.WriteLine("{{type={0},name={1},count={2}}}", archType, name, fileCount);
ExtractPmd1(extrPath, br, len);
sw.WriteLine("{end}");
break;
case 5:
sw.WriteLine("{{type={0},name={1},count={2}}}", archType, name, fileCount);
ExtractTxp0(extrPath, br, len);
sw.WriteLine("{end}");
break;
case 6:
sw.WriteLine("{{type={0},name={1}}}", archType, name);
ExtractPib0(extrPath, br, len);
sw.WriteLine("{end}");
break;
case 7:
sw.WriteLine("{{type={0},name={1}}}", archType, name);
ExtractTmx0Ps2(extrPath, br, len);
sw.WriteLine("{end}");
ms.Position = prevPos;
if (gIterCount == 1)
ms.Position += len;
else
ms.Extract(extrPath + name, len);
break;
case 8:
sw.WriteLine("{{type={0},name={1}}}", archType, name);
ExtractCin(extrPath, br, len);
sw.WriteLine("{end}");
break;
default:
if (gIterCount == 1)
ms.Position += len;
else
{
sw.WriteLine(name);
ms.Extract(extrPath + name, len);
}
break;
}
gIterCount--;
}