首页 新闻 会员 周边

response.write到指定的位置

0
[已关闭问题]

从数据库中读取的图片信息(二进制)response.write到指定的位置

 

武元省的主页 武元省 | 初学一级 | 园豆:200
提问于:2009-04-29 17:43
< >
分享
其他回答(3)
0

期待

Kenny-Chen | 园豆:210 (菜鸟二级) | 2009-04-29 18:01
0
Insus.NET | 园豆:932 (小虾三级) | 2009-04-29 18:37
0

 

A.aspx

            FileStream fs = new FileStream("c:/xx.gif", FileMode.Open);

            byte[] byData = new byte[fs.Length];

            fs.Read(byData, 0, byData.Length);

            fs.Close();

            Response.ClearContent();

    Response.ContentType = "image/Jpeg";

            Response.OutputStream.Write(byData, 0, byData.Length); //byData二进制数据

            Response.End();


B.aspx

    <img src="A.aspx" />

 

黑白之间 | 园豆:859 (小虾三级) | 2009-04-29 22:04
0

你可以先将二进制转化成文件,然后输出

GWPBrian | 园豆:428 (菜鸟二级) | 2009-04-30 09:17
清除回答草稿
   您需要登录以后才能回答,未注册用户请先注册