本文整理汇总了C#中Windows.Storage.Streams.DataReader.ReadDateTime方法的典型用法代码示例。如果您正苦于以下问题:C# DataReader.ReadDateTime方法的具体用法?C# DataReader.ReadDateTime怎么用?C# DataReader.ReadDateTime使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Windows.Storage.Streams.DataReader
的用法示例。
在下文中一共展示了DataReader.ReadDateTime方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: OnRead
private async void OnRead(Object sender, RoutedEventArgs e)
{
StorageFolder local = ApplicationData.Current.LocalFolder;
StorageFile file = await local.GetFileAsync("demo.dat");
if(file != null)
{
string strres = "读到的内容:\n";
using(IRandomAccessStream stream = await file.OpenReadAsync())
{
DataReader dr = new DataReader(stream);
dr.UnicodeEncoding = UnicodeEncoding.Utf8;
await dr.LoadAsync((uint)stream.Size);
bool b = dr.ReadBoolean();
strres += b.ToString() + "\n";
DateTimeOffset dt = dr.ReadDateTime();
strres += dt.ToString("yyyy-M-d") + "\n";
uint len = dr.ReadUInt32();
if(len > 0)
{
strres += dr.ReadString(len);
}
dr.Dispose();
}
tbResult.Text = strres;
}
}
示例2: Read
public void Read(DataReader reader)
{
t = (HeartBeatType)reader.ReadInt32();
time = reader.ReadDateTime().UtcDateTime;
cc = reader.ReadInt64();
asdf = reader.ReadInt64();
peak = reader.ReadInt64();
max0 = reader.ReadUInt64();
max1 = reader.ReadUInt64();
ave0 = reader.ReadUInt64();
ave1 = reader.ReadUInt64();
ave = reader.ReadUInt64();
beat = reader.ReadUInt64();
audio = reader.ReadUInt64();
noAudio = reader.ReadUInt64();
}