更新时间:2023-09-19 22:41:04
第1步是从您的base64字符串转换为字节数组:
Step 1 is converting from your base64 string to a byte array:
byte[] bytes = Convert.FromBase64String(base64BinaryStr);
第二步是保存字节数组到磁盘:
Step 2 is saving the byte array to disk:
System.IO.FileStream stream =
new FileStream(@"C:\file.pdf", FileMode.CreateNew);
System.IO.BinaryWriter writer =
new BinaryWriter(stream);
writer.Write(bytes, 0, bytes.Length);
writer.Close();