當前位置: 首頁>>代碼示例>>C#>>正文


C# __BinaryParser.ReadString方法代碼示例

本文整理匯總了C#中System.Runtime.Serialization.Formatters.Binary.__BinaryParser.ReadString方法的典型用法代碼示例。如果您正苦於以下問題:C# __BinaryParser.ReadString方法的具體用法?C# __BinaryParser.ReadString怎麽用?C# __BinaryParser.ReadString使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在System.Runtime.Serialization.Formatters.Binary.__BinaryParser的用法示例。


在下文中一共展示了__BinaryParser.ReadString方法的8個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。

示例1: Read

 public void Read(__BinaryParser input)
 {
     this.objectId = input.ReadInt32();
     this.name = input.ReadString();
     this.numMembers = input.ReadInt32();
     this.memberNames = new string[this.numMembers];
     this.binaryTypeEnumA = new BinaryTypeEnum[this.numMembers];
     this.typeInformationA = new object[this.numMembers];
     this.memberAssemIds = new int[this.numMembers];
     for (int i = 0; i < this.numMembers; i++)
     {
         this.memberNames[i] = input.ReadString();
     }
     for (int j = 0; j < this.numMembers; j++)
     {
         this.binaryTypeEnumA[j] = (BinaryTypeEnum) input.ReadByte();
     }
     for (int k = 0; k < this.numMembers; k++)
     {
         if ((this.binaryTypeEnumA[k] != BinaryTypeEnum.ObjectUrt) && (this.binaryTypeEnumA[k] != BinaryTypeEnum.ObjectUser))
         {
             this.typeInformationA[k] = BinaryConverter.ReadTypeInfo(this.binaryTypeEnumA[k], input, out this.memberAssemIds[k]);
         }
         else
         {
             BinaryConverter.ReadTypeInfo(this.binaryTypeEnumA[k], input, out this.memberAssemIds[k]);
         }
     }
     if (this.binaryHeaderEnum == BinaryHeaderEnum.ObjectWithMapTypedAssemId)
     {
         this.assemId = input.ReadInt32();
     }
 }
開發者ID:pritesh-mandowara-sp,項目名稱:DecompliedDotNetLibraries,代碼行數:33,代碼來源:BinaryObjectWithMapTyped.cs

示例2: Read

 public void Read(__BinaryParser input)
 {
     this.objectId = input.ReadInt32();
     this.name = input.ReadString();
     this.numMembers = input.ReadInt32();
     this.memberNames = new string[this.numMembers];
     for (int i = 0; i < this.numMembers; i++)
     {
         this.memberNames[i] = input.ReadString();
     }
     if (this.binaryHeaderEnum == BinaryHeaderEnum.ObjectWithMapAssemId)
     {
         this.assemId = input.ReadInt32();
     }
 }
開發者ID:pritesh-mandowara-sp,項目名稱:DecompliedDotNetLibraries,代碼行數:15,代碼來源:BinaryObjectWithMap.cs

示例3: ReadWithCode

        internal static object ReadWithCode(__BinaryParser input)
        {
            InternalPrimitiveTypeE code = (InternalPrimitiveTypeE) input.ReadByte();
            switch (code)
            {
                case InternalPrimitiveTypeE.Null:
                    return null;

                case InternalPrimitiveTypeE.String:
                    return input.ReadString();
            }
            return input.ReadValue(code);
        }
開發者ID:pritesh-mandowara-sp,項目名稱:DecompliedDotNetLibraries,代碼行數:13,代碼來源:IOUtil.cs

示例4: ReadTypeInfo

        internal static object ReadTypeInfo(BinaryTypeEnum binaryTypeEnum, __BinaryParser input, out int assemId)
        {
            object obj2 = null;
            int num = 0;
            switch (binaryTypeEnum)
            {
                case BinaryTypeEnum.Primitive:
                case BinaryTypeEnum.PrimitiveArray:
                    obj2 = (InternalPrimitiveTypeE) input.ReadByte();
                    break;

                case BinaryTypeEnum.String:
                case BinaryTypeEnum.Object:
                case BinaryTypeEnum.ObjectArray:
                case BinaryTypeEnum.StringArray:
                    break;

                case BinaryTypeEnum.ObjectUrt:
                    obj2 = input.ReadString();
                    break;

                case BinaryTypeEnum.ObjectUser:
                    obj2 = input.ReadString();
                    num = input.ReadInt32();
                    break;

                default:
                    throw new SerializationException(Environment.GetResourceString("Serialization_TypeRead", new object[] { binaryTypeEnum.ToString() }));
            }
            assemId = num;
            return obj2;
        }
開發者ID:pritesh-mandowara-sp,項目名稱:DecompliedDotNetLibraries,代碼行數:32,代碼來源:BinaryConverter.cs

示例5: Read

 public void Read(__BinaryParser input)
 {
     this.assemId = input.ReadInt32();
     this.assemblyString = input.ReadString();
 }
開發者ID:pritesh-mandowara-sp,項目名稱:DecompliedDotNetLibraries,代碼行數:5,代碼來源:BinaryAssembly.cs

示例6: Read

        [System.Security.SecurityCritical] // implements Critical method 
        public void Read(__BinaryParser input)
        { 
            // binaryHeaderEnum has already been read 
            objectId = input.ReadInt32();
            name = input.ReadString(); 
            numMembers = input.ReadInt32();
            memberNames = new String[numMembers];
            binaryTypeEnumA = new BinaryTypeEnum[numMembers];
            typeInformationA = new Object[numMembers]; 
            memberAssemIds = new Int32[numMembers];
            for (int i=0; i<numMembers; i++) 
                memberNames[i] = input.ReadString(); 
            for (int i=0; i<numMembers; i++)
                binaryTypeEnumA[i] = (BinaryTypeEnum)input.ReadByte(); 
            for (int i=0; i<numMembers; i++)
                if (binaryTypeEnumA[i] != BinaryTypeEnum.ObjectUrt && binaryTypeEnumA[i] != BinaryTypeEnum.ObjectUser)
                    typeInformationA[i] = BinaryConverter.ReadTypeInfo(binaryTypeEnumA[i], input, out memberAssemIds[i]);
                else 
                    BinaryConverter.ReadTypeInfo(binaryTypeEnumA[i], input, out memberAssemIds[i]);
 
            if (binaryHeaderEnum == BinaryHeaderEnum.ObjectWithMapTypedAssemId) 
            {
                assemId = input.ReadInt32(); 
            }
        }
開發者ID:wsky,項目名稱:System.Runtime.Remoting,代碼行數:26,代碼來源:BinaryCommonClasses.cs

示例7: ReadWithCode

 internal static Object ReadWithCode(__BinaryParser input) 
 { 
      InternalPrimitiveTypeE code = (InternalPrimitiveTypeE)input.ReadByte();
      if (code == InternalPrimitiveTypeE.Null) 
          return null;
      else if (code == InternalPrimitiveTypeE.String)
          return input.ReadString();
      else 
          return input.ReadValue(code);
 } 
開發者ID:wsky,項目名稱:System.Runtime.Remoting,代碼行數:10,代碼來源:BinaryCommonClasses.cs

示例8: ReadTypeInfo

        // Reads the type information from the wire
        internal static Object ReadTypeInfo(BinaryTypeEnum binaryTypeEnum, __BinaryParser input, out int assemId) 
        { 
            SerTrace.Log( "BinaryConverter", "ReadTypeInfo Entry  ",((Enum)binaryTypeEnum).ToString());
            Object var = null; 
            int readAssemId = 0;

            switch (binaryTypeEnum)
            { 
                case BinaryTypeEnum.Primitive:
                case BinaryTypeEnum.PrimitiveArray: 
                    var = (InternalPrimitiveTypeE)input.ReadByte(); 
                    break;
                case BinaryTypeEnum.String: 
                case BinaryTypeEnum.Object:
                case BinaryTypeEnum.StringArray:
                case BinaryTypeEnum.ObjectArray:
                    break; 
                case BinaryTypeEnum.ObjectUrt:
                    var = input.ReadString(); 
                    break; 
                case BinaryTypeEnum.ObjectUser:
                    var = input.ReadString(); 
                    readAssemId = input.ReadInt32();
                    break;
                default:
                    throw new SerializationException(Environment.GetResourceString("Serialization_TypeRead",((Enum)binaryTypeEnum).ToString())); 
            }
            SerTrace.Log( "BinaryConverter", "ReadTypeInfo Exit  ",var," assemId ",readAssemId); 
            assemId = readAssemId; 
            return var;
        } 
開發者ID:wsky,項目名稱:System.Runtime.Remoting,代碼行數:32,代碼來源:BinaryCommonClasses.cs


注:本文中的System.Runtime.Serialization.Formatters.Binary.__BinaryParser.ReadString方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。