`

a tedious way to convert byte array into String

阅读更多

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

分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics