二进制的图片如何显示在网页上??????
代码如下:
SqlConnection con = new SqlConnection(strConn);
con.Open();
SqlCommand com = new SqlCommand("select top 1 photo from employees where photo is not null", con);
SqlDataReader dr = com.ExecuteReader();
dr.Read();
//Response.ContentType = "application/octet-stream";
Response.ContentType = "image/jpeg";
byte[] sss = (byte[])dr["photo"];
Response.BinaryWrite((byte[])sss);
Image1.Attributes.Add("src","Default3.aspx");
结果:
出现了一个文件下,在文件来的下级目录才会显示图片;Documents and Settings/hm_user_026/桌面/新資料夾/1.jpg;
听说这二进制是压缩了,
如何求解;