Your code is totally wrong.
You need to parse out the actual base64 data from that string, by removing everything before the first comma.
You can then call Convert.FromBase64String()
on that data.
string source = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAABG4...YII=";
string base64 = source.Substring(source.IndexOf(',') + 1);
byte[] data = Convert.FromBase64String(base64);
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…