MemoryStream^ st = gcnew MemoryStream();
array<Byte>^ byteArray;
byteArray = gcnew array<Byte>((__int64)st->Length);
st->Read(byteArray, (__int64)0, st->Length);
writer->Close();
st->Close();
System::Text::Encoding^ ee = System::Text::Encoding::GetEncoding("GB2312");
Console::Write(ee->GetString(byteArray));
Because of unfamilar with .net framework, i wrote above codes. After that i found out use StreamReader was more convenient
本文介绍了在.NET Framework中使用MemoryStream进行数据读取的方法,并对比了使用StreamReader的便捷性。通过对MemoryStream的操作来读取数据并转换为指定编码格式的字符串。

被折叠的 条评论
为什么被折叠?



