且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

如何将一串文本从 Base64 解码为字节数组,并在不损坏数据的情况下获取该字节数组的字符串属性

更新时间:2023-11-15 19:07:16

如果字符串被编码,那么内容看起来很像您在文本文件中的内容.但是为了确保文件不会损坏,您应该将文件内容写入二进制而不是使用文本编码器.查看 File.WriteAllBytes().

If the string is encoded then the contents would look much like what you have in your text file. But to ensure that the file is not getting corrupt you should write the file content as binary instead of using a text encoder. Check out File.WriteAllBytes().