C#中Base64转换为byte[]再进行处理

byte[] arr = Convert.FromBase64String(temp.Substring(temp.IndexOf(",") + 1));
using (Stream stream = new MemoryStream(arr))
{
  //处理代码
}

  若前端传入base64参数携带前缀“data:image/png;base64,......”,则需将逗号前内容删除在进行转换。

猜你喜欢

转载自www.cnblogs.com/xiaosuxing/p/12047487.html
今日推荐