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


C# Stream.ReadString方法代码示例

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


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

示例1: NpgsqlParameterStatus

 public NpgsqlParameterStatus(Stream stream)
 {
     //Read message length
     stream.EatStreamBytes(4);
     Parameter = stream.ReadString();
     ParameterValue = stream.ReadString();
 }
开发者ID:timoch,项目名称:Npgsql-fdb,代码行数:7,代码来源:NpgsqlParameterStatus.cs

示例2: Read

 public static void Read(Stream stream, GameObject instance)
 {
     instance.name = stream.ReadString();
     instance.tag = stream.ReadString();
     instance.layer = stream.ReadInt();
     instance.isStatic = stream.ReadBool();
     instance.SetActive(stream.ReadBool());
 }
开发者ID:srndpty,项目名称:VFW,代码行数:8,代码来源:GameObjectSerializer.cs

示例3: Read

        public void Read(Stream stream)
        {
            this.ChannelCount = stream.ReadInt32();
            this.BitsPerSample = stream.ReadInt32();
            this.SampleRate = stream.ReadInt32();
            this.FinalSampleCount = stream.ReadInt64();

            this.OutputFormat = stream.ReadString();
            this.CompressionLevel = stream.ReadInt32();
        }
开发者ID:karamanolev,项目名称:MusicDatabase,代码行数:10,代码来源:EncodingRequestMessage.cs

示例4: Read

		public static CommentExtension Read(Stream stream)
		{
			var result = new CommentExtension
				{
					CommentData = new List<string>()
				};

			var blockSize = stream.ReadByte();
			while (blockSize > 0)
			{
				var commentData = stream.ReadString(blockSize);
				result.CommentData.Add(commentData);

				blockSize = stream.ReadByte();
			}

			return result;
		}
开发者ID:krabishe,项目名称:GIF89a.Transformation,代码行数:18,代码来源:CommentExtension.cs

示例5: ParseResponse

        private void ParseResponse(Stream response)
        {
            string html = response.ReadString();

            if (html.Contains("欢迎您"))
                return;

            if (html.Contains("密码输入错误") || html.Contains("密码长度不能少于") || html.Contains("登录名不存在"))
            {
                Update();
                throw new InvalidPasswordException();
            }

            if (html.Contains("当前访问用户过多,请稍后重试"))
                throw new TooManyUsersException();

            if (html.Contains("您的用户已经被锁定"))
                throw new AccountLockedException();

            if (html.Contains("请输入正确的验证码"))
                throw new InvalidCaptchaException();

            throw new Unknown12306ResponceException(html);
        }
开发者ID:xinhuang,项目名称:Desperate-12306,代码行数:24,代码来源:Client.cs

示例6: Decode

		public static Image Decode(Stream stream)
		{
			var result = new Image
				{
					Header = stream.ReadString(6),
					LogicalScreenDescriptor = LogicalScreenDescriptor.Read(stream)
				};

			if (result.LogicalScreenDescriptor.GlobalColorTableFlag)
			{
				result.GlobalColorTable = stream.ReadBytes(result.LogicalScreenDescriptor.GlobalColorTableSize * 3);
			}

			GraphicControlExtension graphicControlExtension = null;

			var componentType = stream.ReadByte();
			while (componentType != 0)
			{
				if (componentType == ImageDescriptor.ImageSeparator)
				{
					var imageFrame = ReadImageFrame(stream, result.GlobalColorTable, graphicControlExtension);
					result.Frames.Add(imageFrame);
				}
				else if (componentType == Const.ExtensionIntroducer)
				{
					var extensionType = stream.ReadByte();
					switch (extensionType)
					{
						case GraphicControlExtension.GraphicControlLabel:
							{
								graphicControlExtension = GraphicControlExtension.Read(stream);
								break;
							}
						case CommentExtension.CommentLabel:
							{
								var commentExtension = CommentExtension.Read(stream);
								result.CommentExtensions.Add(commentExtension);
								break;
							}
						case ApplicationExtension.ExtensionLabel:
							{
								var applicationExtension = ApplicationExtension.Read(stream);
								result.ApplictionExtensions.Add(applicationExtension);
								break;
							}
						case PlainTextExtension.PlainTextLabel:
							{
								var plainTextExtension = PlainTextExtension.Read(stream);
								result.PlainTextEntensions.Add(plainTextExtension);
								break;
							}
					}
				}
				else if (componentType == Const.EndIntroducer)
				{
					break;
				}

				componentType = stream.ReadByte();
			}

			return result;
		}
开发者ID:krabishe,项目名称:GIF89a.Transformation,代码行数:63,代码来源:GifDecoder.cs

示例7: Decode

        public override void Decode(Stream stream)
        {
            //variable header
            TopicName = stream.ReadString();
            if (FixedHeader.Qos == Qos.AtLeastOnce || FixedHeader.Qos == Qos.ExactlyOnce)
                MessageIdentifier = stream.ReadShort();

            //playload
            var len = FixedHeader.RemaingLength - (TopicName.Length + 2);
            Payload = new byte[len];
            stream.Read(Payload, 0, len);
        }
开发者ID:expansion,项目名称:nMqtt,代码行数:12,代码来源:PublishMessage.cs


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