本文整理汇总了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();
}
示例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());
}
示例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();
}
示例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;
}
示例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);
}
示例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;
}
示例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);
}