孤独的猫

  博客园 :: 首页 :: 博问 :: 闪存 :: 新随笔 :: 联系 :: 订阅 订阅 :: 管理 ::
show.asp----------------图像显示页面
<%
  set rs=Server.CreateObject("ADODB.Recordset")
  sql="select top 1 * from newstable2 order by id desc"
  rs.open sql,conn,1,3
%>
<html>
  新闻文本:<%=rs("text")%><br>
  新闻图像:<% If IsNull(rs("picture"))=false then%><img src=showing.asp?id=<%=rs("id") %>> <% end if %>
</html>


showing.asp----------------图像处理页面
<%
  id=request("id")
  set rs=Server.CreateObject("adodb.recordset" )
  sql="select * from newstable2 where id=" & id
  rs.open sql,conn,1,3
  response.contentype="image/gif"
  response.Binarywrite rs("picture")
%>
如要显示数据库中的word文件,则可用response.contenttype="application/msword"



posted on 2008-09-20 22:18  孤独的猫  阅读(243)  评论(0编辑  收藏  举报