我需要Image1.Imageurl的帮助,我的代码只在IE中显示图像,但在Chrome中不显示。基本上我创建了通用处理程序来从数据库获取图像并将其传递给Image控制器。请告知我如何在Chrome和IE中使其运行。以下是我的代码,谢谢。
Dim fileName As String = context.Request.QueryString("fn")
Dim con As New SqlConnection(ConfigurationManager.ConnectionStrings("SQLConnection").ConnectionString)
con.Open()
Dim cmd As New SqlCommand("Select binary from ImageProcess where fileName = '" & fileName & "'", con)
Dim dr As SqlDataReader = cmd.ExecuteReader
dr.Read()
Dim b64 As String = dr(0).ToString.Replace(" ", "+")
Dim b() As Byte
b = Convert.FromBase64String(b64)
HttpContext.Current.Response.ContentType = "image/tiff"
context.Response.BinaryWrite(b)
con.Close()
context.Response.[End]()