base64编码在线转换 怎么将base64编码提交到后台?
怎么将base64编码提交到后台?导入sun.misc.base64编码器导入sun.misc.base64解码器//Encode s into Base64public static string
怎么将base64编码提交到后台?
导入sun.misc.base64编码器
导入sun.misc.base64解码器
//Encode s into Base64
public static string getbase64(string s){
if(s==null)return null
返回(New)sun.misc.base64编码器()). Encode(s.getbytes())
}
//解码base64编码的字符串s
公共静态字符串getfrombase64(字符串s){
if(s)==null)return null
BASE64Decoder decoder=new BASE64Decoder()
try{
byte[]b=解码器.decodeBuffer(s)
return new String(b)
}catch(Exception e){
return null
}
}