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


C# StringBuilder.AppendLineSpace方法代码示例

本文整理汇总了C#中StringBuilder.AppendLineSpace方法的典型用法代码示例。如果您正苦于以下问题:C# StringBuilder.AppendLineSpace方法的具体用法?C# StringBuilder.AppendLineSpace怎么用?C# StringBuilder.AppendLineSpace使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在StringBuilder的用法示例。


在下文中一共展示了StringBuilder.AppendLineSpace方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: ToString

        public string ToString(bool formatted)
        {
            var b = new StringBuilder();
            b.AppendLine("XbfsEntry:");

            string fmt = formatted ? "    " : "";

            if (!Padding.IsArrayEmpty())
                b.AppendLineSpace(fmt + "Padding != null");

            b.AppendLine();

            b.AppendLineSpace(fmt + "LBA: 0x" + LBA.ToString("X") + " (0x" + (LBA * 0x1000).ToString("X") + ")");
            b.AppendLineSpace(fmt + "Length: 0x" + Length.ToString("X") + " (0x" + (Length * 0x1000).ToString("X") + ")");
            b.AppendLineSpace(fmt + "Padding: " + Padding.ToHexString());

            return b.ToString();
        }
开发者ID:Overx,项目名称:xvdtool,代码行数:18,代码来源:XBFSStructs.cs

示例2: ToString

        public string ToString(bool formatted)
        {
            var b = new StringBuilder();

            string fmt = formatted ? "    " : "";

            b.AppendLine("XvdMiscInfo:");
            b.AppendLineSpace(fmt + "Block Count: 0x" + XvdDataBlockCount.ToString("X"));

            if (Header.EmbeddedXVDLength > 0)
                b.AppendLineSpace(fmt + "Embedded XVD Offset: 0x3000");

            if(Header.UserDataLength > 0)
                b.AppendLineSpace(fmt + "User Data Offset: 0x" + UserDataOffset.ToString("X"));

            b.AppendLineSpace(fmt + "XVD Data Offset: 0x" + DataOffset.ToString("X"));

            if (IsDataIntegrityEnabled)
            {
                b.AppendLineSpace(fmt + "Hash Tree Block Count: 0x" + HashTreeBlockCount.ToString("X"));
                b.AppendLineSpace(fmt + "Hash Tree Levels: 0x" + HashTreeLevels.ToString("X"));
                b.AppendLineSpace(fmt + "Hash Tree Valid: " + (HashTreeValid ? "true" : "false"));

                if (!DisableDataHashChecking)
                    b.AppendLineSpace(fmt + "Data Hash Tree Valid: " + (DataHashTreeValid ? "true" : "false"));
            }

            if(IsXvcFile)
                b.AppendLineSpace(fmt + "XVC Data Hash Valid: " + (XvcDataHashValid ? "true" : "false"));

            b.AppendLine();
            b.Append(Header.ToString(formatted));

            if (XvcInfo.ContentID == null)
                return b.ToString();

            b.AppendLine();
            if (formatted)
            {
                byte[] decryptKey;
                string licenseFile = GetXvcKey(0, out decryptKey);
                if (!String.IsNullOrEmpty(licenseFile))
                {
                    if (licenseFile != "testsigned")
                        b.AppendLine("Decrypt key from license file " + licenseFile +
                                     " (key is wrong though until the obfuscation/encryption on it is figured out)");
                    else
                        b.AppendLine("Decrypt key for test-signed package:");

                    b.AppendLine(decryptKey.ToHexString());
                    b.AppendLine();
                }
            }
            b.AppendLine(XvcInfo.ToString(formatted));

            if(RegionHeaders != null)
                for (int i = 0; i < RegionHeaders.Count; i++)
                {
                    b.AppendLine();
                    b.AppendLine("Region " + i);
                    b.Append(RegionHeaders[i].ToString(formatted));
                }

            if (RegionHeaders != null)
                for (int i = 0; i < UpdateSegments.Count; i++)
                {
                    if (UpdateSegments[i].Unknown1 == 0)
                        break;
                    b.AppendLine();
                    b.AppendLine("Update Segment " + i);
                    b.Append(UpdateSegments[i].ToString(formatted));
                }

            return b.ToString();
        }
开发者ID:Overx,项目名称:xvdtool,代码行数:75,代码来源:XVDFile.cs

示例3: ToString

        public string ToString(bool formatted)
        {
            var b = new StringBuilder();
            b.AppendLine("XvdHeader:");

            string fmt = formatted ? "    " : "";

            if (FormatVersion != 3)
                b.AppendLineSpace(fmt + "FormatVersion != 3");
            if (Unknown1_HashTableRelated != 1)
                b.AppendLineSpace(fmt + "Unknown1 != 1");
            if (Unknown2 != 0xAA000)
                b.AppendLineSpace(fmt + "Unknown2 != 0xAA000");
            if (!Unknown3.IsArrayEmpty())
                b.AppendLineSpace(fmt + "Unknown3 != null");
            if (Unknown4 != 0)
                b.AppendLineSpace(fmt + "Unknown4 != 0");
            if (!Unknown5.IsArrayEmpty())
                b.AppendLineSpace(fmt + "Unknown5 != null");
            if (Unknown6 != 0)
                b.AppendLineSpace(fmt + "Unknown6 != 0");
            if (Unknown7 != 0)
                b.AppendLineSpace(fmt + "Unknown7 != 0");
            if (!Unknown8.IsArrayEmpty())
                b.AppendLineSpace(fmt + "Unknown8 != null");
            if (!Reserved.IsArrayEmpty())
                b.AppendLineSpace(fmt + "Reserved != null");

            if (!Enum.IsDefined(typeof(XvdContentType), ContentType))
                b.AppendLineSpace(fmt + "Unknown content type 0x" + ContentType.ToString("X"));

            b.AppendLineSpace(fmt + (IsSignedWithRedKey ? "Signed" : "Not signed") + " with red key");

            if (VolumeFlags.IsFlagSet((uint)XvdVolumeFlags.SystemFile))
                b.AppendLineSpace(fmt + "System file");

            b.AppendLineSpace(fmt + "Read-only flag " + (VolumeFlags.IsFlagSet((uint)XvdVolumeFlags.ReadOnly) ? "set" : "not set"));

            b.AppendLineSpace(fmt + (VolumeFlags.IsFlagSet((uint)XvdVolumeFlags.EncryptionDisabled)
                ? "Decrypted"
                : "Encrypted"));

            if (Unk_0x2_Means_Test_ODK != 0)
            {
                if (Unk_0x2_Means_Test_ODK == 0x2)
                    b.AppendLineSpace(fmt + "(using test ODK) (maybe)");
                else
                    b.AppendLineSpace(fmt + "Unk_0x2_Means_Test_ODK != 0 && != 2! (actually 0x" + Unk_0x2_Means_Test_ODK.ToString("X") + ")");
            }

            b.AppendLineSpace(fmt + (VolumeFlags.IsFlagSet((uint)XvdVolumeFlags.DataIntegrityDisabled)
                ? "Data integrity disabled (doesn't use hash tree)"
                : "Data integrity enabled (uses hash tree)"));

            b.AppendLineSpace(fmt + "Unknown flag 0x40 " + (VolumeFlags.IsFlagSet((uint)XvdVolumeFlags.Unknown) ? "set" : "not set"));

            b.AppendLine();

            b.AppendLineSpace(fmt + "Magic: " + new string(Magic));
            b.AppendLineSpace(fmt + "Volume Flags: 0x" + VolumeFlags.ToString("X"));

            string contentType = "0x" + ContentType.ToString("X") + " (" + ((XvdContentType)ContentType) + ")";

            b.AppendLineSpace(fmt + "File Time Created: " + DateTime.FromFileTime(FileTimeCreated));
            b.AppendLineSpace(fmt + "Drive Size: 0x" + DriveSize.ToString("X"));
            b.AppendLineSpace(fmt + "Format Version: 0x" + FormatVersion.ToString("X"));

            b.AppendLineSpace(fmt + String.Format("VDUID / Drive Id: {0} (UDUID / User Id: {1})", new Guid(VDUID), new Guid(UDUID)));
            b.AppendLineSpace(fmt + "Content Type: " + contentType);
            b.AppendLineSpace(fmt + "Embedded XVD PDUID/Build Id: " + new Guid(EmbeddedXVD_PDUID));
            b.AppendLineSpace(fmt + "Embedded XVD Length: 0x" + EmbeddedXVDLength.ToString("X"));
            b.AppendLineSpace(fmt + "User Data Length: 0x" + UserDataLength.ToString("X"));
            b.AppendLineSpace(fmt + "XVC Data Length: 0x" + XvcDataLength.ToString("X"));
            b.AppendLineSpace(fmt + "Dynamic Header Length: 0x" + DynamicHeaderLength.ToString("X"));
            b.AppendLineSpace(fmt + "Top Hash Block Hash:" + Environment.NewLine + fmt + TopHashBlockHash.ToHexString());
            b.AppendLineSpace(fmt + "Original XVC Data Hash:" + Environment.NewLine + fmt + OriginalXvcDataHash.ToHexString());
            b.AppendLineSpace(fmt + "Sandbox Id: " + new string(SandboxId).Replace("\0", ""));
            b.AppendLineSpace(fmt + "Product Id: " + new Guid(ProductId));
            b.AppendLineSpace(fmt + "PDUID/Build Id: " + new Guid(PDUID));
            b.AppendLineSpace(fmt + String.Format("Package Version: {3}.{2}.{1}.{0}", PackageVersion1, PackageVersion2, PackageVersion3, PackageVersion4));
            b.AppendLineSpace(fmt + String.Format("Required System Version: {3}.{2}.{1}.{0}", RequiredSystemVersion1, RequiredSystemVersion2, RequiredSystemVersion3, RequiredSystemVersion4));
            b.AppendLineSpace(fmt + "Encrypted CIK:" + Environment.NewLine + fmt + EncryptedCIK.ToHexString());
            b.AppendLineSpace(fmt + "PECatalogInfo0: 0x" + PECatalogInfo0.ToString("X"));

            string catalogInfo1 = "";
            foreach (ulong catalogInfo in PECatalogInfo1)
                catalogInfo1 += "0x" + catalogInfo.ToString("X") + " ";

            b.AppendLine(fmt + "PECatalogInfo1: " + catalogInfo1);

            string catalogInfo2 = "";
            foreach (ulong catalogInfo in PECatalogInfo2)
                catalogInfo2 += "0x" + catalogInfo.ToString("X") + " ";

            b.AppendLine(fmt + "PECatalogInfo2: " + catalogInfo2);

            b.AppendLine(fmt + "PECatalogInfo3: ");
            b.Append(fmt);
            foreach (ulong catalogInfo in PECatalogInfo3)
                b.Append("0x" + catalogInfo.ToString("X") + " ");
//.........这里部分代码省略.........
开发者ID:Overx,项目名称:xvdtool,代码行数:101,代码来源:XVDStructs.cs


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