本文整理汇总了C#中PacketReader.ReadAnsiString方法的典型用法代码示例。如果您正苦于以下问题:C# PacketReader.ReadAnsiString方法的具体用法?C# PacketReader.ReadAnsiString怎么用?C# PacketReader.ReadAnsiString使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PacketReader
的用法示例。
在下文中一共展示了PacketReader.ReadAnsiString方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: UnicodeSpeechRequest
public UnicodeSpeechRequest(byte[] data)
: base(data)
{
PacketReader reader = new PacketReader(data);
byte id = reader.ReadByte();
ushort blockSize = reader.ReadUInt16();
byte type = reader.ReadByte();
this.type = (byte)(type & 0x0F);
color = reader.ReadUInt16();
font = reader.ReadUInt16();
language = reader.ReadAnsiString(4);
if ((type & 0xC0) != 0)
{
int numKeywords = (Data[12] << 4) + (Data[13] >> 4);
reader.Skip(((numKeywords * 12 + 12) + 7) / 8);
text = reader.ReadAnsiString(Lenght - reader.Offset);
}
else
{
text = reader.ReadUnicodeString(Lenght - reader.Offset);
}
}
示例2: Menu
public Menu(byte[] data)
: base(data)
{
PacketReader reader = new PacketReader(data);
byte id = reader.ReadByte();
ushort blockSize = reader.ReadUInt16();
dialogSerial = reader.ReadUInt32();
menuSerial = reader.ReadUInt16();
byte titleLen = reader.ReadByte();
title = reader.ReadAnsiString(titleLen);
byte optionCount = reader.ReadByte();
MenuOption[] optionList = new MenuOption[optionCount];
for (int i = 0; i < optionCount; i++) {
optionList[i].Artwork = reader.ReadUInt16();
optionList[i].Hue = reader.ReadUInt16();
byte textLen = reader.ReadByte();
optionList[i].Text = reader.ReadAnsiString(textLen);
}
options = Array.AsReadOnly<MenuOption>(optionList);
// if (reader.Offset == reader.Length)
// System.Diagnostics.Debug.WriteLine("Menu packet resolved succesfully.", "Communication");
}