1、若base64转二进制
//var base64 = "";
//base64 = mess.Content.Replace("data:image/png;base64,", "").Replace("data:image/jgp;base64,", "").Replace("data:image/jpg;base64,", "").Replace("data:image/jpeg;base64,", "");//将base64头部信息替换
//byte[] bytes = Convert.FromBase64String(base64);
2、保存图片(数据库保存图片名,路径,图片存服务器)
ImageHelper pic = new ImageHelper();
string filename = "";
string url = pic.BannerImg(mess.Content, out filename);
public string BannerImg(string img,out string filename)
{try
{
//string pic = img.Substring(0, 22);
int s = img.