星期六

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)

posted on 2006-12-21 15:03  星期六  阅读(1042)  评论(0编辑  收藏  举报