Sve*_*lov 22
byte[] b = File.ReadAllBytes(file);
Run Code Online (Sandbox Code Playgroud)
打开二进制文件,将文件内容读入字节数组,然后关闭文件.
And*_*are 11
试试这个:
Byte[] result
= (Byte[])new ImageConverter().ConvertTo(yourImage, typeof(Byte[]));
Run Code Online (Sandbox Code Playgroud)
由于你有一个文件使用: -
Response.ContentType = "image/png";
Response.WriteFile(physicalPathOfPngFile);
Run Code Online (Sandbox Code Playgroud)