本文整理匯總了C#中Windows.Storage.Streams.DataReader.ReadUInt16方法的典型用法代碼示例。如果您正苦於以下問題:C# DataReader.ReadUInt16方法的具體用法?C# DataReader.ReadUInt16怎麽用?C# DataReader.ReadUInt16使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Windows.Storage.Streams.DataReader
的用法示例。
在下文中一共展示了DataReader.ReadUInt16方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。
示例1: OnPerformAction
private async void OnPerformAction()
{
var stream = socket.OutputStream;
using (var writer = new DataWriter(stream))
{
writer.ByteOrder = ByteOrder.LittleEndian;
//writer.WriteInt16(6);
//writer.WriteByte(0x00);
//writer.WriteByte(3);
//writer.WriteUInt16(1500);
//writer.WriteUInt16(1000);
//var bytes = new byte[] { 6, 0, 0, 3, 220, 5, 232, 3 };
//writer.WriteBytes(bytes);
writer.WriteInt16(12);
writer.WriteByte(Byte0);
writer.WriteByte(Byte1);
writer.WriteByte(Byte2);
writer.WriteByte(Byte3);
writer.WriteByte(Byte4);
writer.WriteByte(Byte5);
writer.WriteByte(Byte6);
writer.WriteByte(Byte7);
writer.WriteUInt32(FourBytes);
await writer.StoreAsync();
writer.DetachStream();
}
using (var reader = new DataReader(socket.InputStream))
{
reader.ByteOrder = ByteOrder.LittleEndian;
await reader.LoadAsync(5);
var length = reader.ReadUInt16();
var byte1 = reader.ReadByte();
var byte2 = reader.ReadByte();
var status = reader.ReadByte();
reader.DetachStream();
}
}