110,533
社区成员
发帖
与我相关
我的任务
分享
string str = "aGVsbG8KW7ncwO3UsV0=";
byte[] contBytes = Convert.FromBase64String(str);
str = Encoding.GetEncoding("gb2312").GetString(contBytes);
str=str.Substring(1,str.IndexOf("\r\n"));
public static string RemoveNonB64(string strText)
{
return strText.Replace("\0","");
}
public static string deCodeB64s(string strText)
{
return Encoding.Default.GetString(deCodeB64(strText));
}
private static byte []deCodeB64(string strText)
{
byte[] by=null;
try
{
if(strText!="")
{
by=Convert.FromBase64String(strText);
//strText=Encoding.Default.GetString(by);
}
}
catch(Exception e)
{
by=Encoding.Default.GetBytes("\0");
LogError("deCodeB64():"+e.Message);
}
return by;
}
string str = "aGVsbG8KW7ncwO3UsV0=";
byte[] contBytes = Convert.FromBase64String(str);
str = Encoding.GetEncoding("gb2312").GetString(contBytes);
Console.WriteLine(str);