当前位置: 移动技术网 > IT编程>开发语言>c# > C# Base 64 编码/解码实现代码

C# Base 64 编码/解码实现代码

2019年07月18日  | 移动技术网IT编程  | 我要评论
1、base64 to string string strpath = "ahr0cdovlziwmy44ms4yos40njo1ntu3l1 9iyw

1、base64 to string

   string strpath = "ahr0cdovlziwmy44ms4yos40njo1ntu3l1
 9iywlkds9yaw5ncy9tawrplziwmda3mzgwlte2lm1pza==";     
   byte[] bpath = convert.frombase64string(strpath);
   strpath = system.text.asciiencoding.default.getstring(bpath);

2、string to base64

system.text.encoding encode = system.text.encoding.ascii ;
byte[] bytedata = encode.getbytes( "test");
string strpath = convert.tobase64string(bytedata,0,bytedata.length);

如您对本文有疑问或者有任何想说的,请点击进行留言回复,万千网友为您解惑!

相关文章:

验证码:
移动技术网