您的位置:首页 > 编程语言 > ASP

ASP.NET 用读取二进制代码的方法在页面上显示指定图片。

2006-12-21 15:03 1026 查看
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)
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: