当前位置: 首页>>代码示例>>C#>>正文


C# IO.Extract方法代码示例

本文整理汇总了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);
                    }
            }
        }
开发者ID:bsv798,项目名称:p3fes,代码行数:20,代码来源:iso.cs

示例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--;
        }
开发者ID:bsv798,项目名称:p3fes,代码行数:81,代码来源:arch.cs


注:本文中的System.IO.Extract方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。