如何使用 c# 在 Windows 8 中将 memorystream 对象编码为字符串?
代码片段:
DataContractJsonSerializer serializer = new DataContractJsonSerializer(obj.GetType());
using (MemoryStream ms = new MemoryStream())
{
serializer.WriteObject(ms, obj);
//return Encoding.Default.GetString(ms.ToArray()); //problem in this line
}