當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。