ASP.NET 用读取二进制代码的方法在页面上显示指定图片。
Dim img As String
=
Server.MapPath(
"
images/errIoc.gif
"
) Dim frd As New FileStream(img, FileMode.Open) Dim imgbyte(frd.Length) As Byte frd.Read(imgbyte,
0
, frd.Length) frd.Close() frd
=
Nothing Response.ClearContent() Response.ContentType
=
"
image/Gif
"
Response.BinaryWrite(imgbyte)