小编sam*_*yte的帖子

字节转换为字节转换令人费解的错误

有谁可以请帮助发现错误?这是代码:

   byte[] oriBytes = { 0xB0, 0x2D };                       // oriBytes -> 0xB0, 0x2D
   string oriInStr = Encoding.ASCII.GetString(oriBytes);   // oriInStr ->   "?-"
   oriBytes = Encoding.ASCII.GetBytes(oriInStr);           // oriBytes -> 0x3F, 0x2D
Run Code Online (Sandbox Code Playgroud)

我无法取回原来的字节值0xB0,0x2D.

c# string byte getstring

4
推荐指数
1
解决办法
483
查看次数

标签 统计

byte ×1

c# ×1

getstring ×1

string ×1