How to read value of type “IBuffer” as string in c#?

后端 未结 1 1442
臣服心动
臣服心动 2021-01-18 08:25

How can I copy a variable which is of type IBuffer in C# (UWP app) to a string? The IBuffer itself doesn\'t seem to have any methods. It has Length which seems to be the c

相关标签:
1条回答
  • 2021-01-18 09:06

    For example you can use it like this:

    var dataReader = Windows.Storage.Streams.DataReader.FromBuffer(Data);
    var output = dataReader.ReadString(Data.Length);
    

    You can find same example here. https://msdn.microsoft.com/ru-ru/library/windows/apps/hh464978

    0 讨论(0)
提交回复
热议问题