本文整理匯總了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();
}