怎样用asp输出图片的二进制数据,我想通过循环来实现每次只显示一张图片且不同。循环应该怎样写?
相关代码,如下:<%DimstrsqlSetrs=Server.CreateObject("ADODB.Recordset")strsql="select*fromima...
相关代码,如下:<%Dim strsql
Set rs=Server.CreateObject("ADODB.Recordset")
strsql="select * from images"
rs.Open strsql,conn,1,1
%>
<%Do While Not rs.EOF %>
<img src=showimage.asp?id=<%=rs("id")%>>
<%rs.movenext
Loop
%>
showimage.asp如下:
<%@LANGUAGE="VBSCRIPT" CODEPAGE="936"%>
<!--#include file="conn/conn.asp"-->
<%
Dim rs,strsql
Response.ContentType="image/*"
Set rs=server.createobject("ADODB.Recordset")
strsql="select * from images where id=" & Request("id")
rs.open strsql,conn,1,1
Response.BinaryWrite rs("image").GetChunk(7500000)
rs.Close
Set rs=nothing
Set conn=nothing
%> 展开
Set rs=Server.CreateObject("ADODB.Recordset")
strsql="select * from images"
rs.Open strsql,conn,1,1
%>
<%Do While Not rs.EOF %>
<img src=showimage.asp?id=<%=rs("id")%>>
<%rs.movenext
Loop
%>
showimage.asp如下:
<%@LANGUAGE="VBSCRIPT" CODEPAGE="936"%>
<!--#include file="conn/conn.asp"-->
<%
Dim rs,strsql
Response.ContentType="image/*"
Set rs=server.createobject("ADODB.Recordset")
strsql="select * from images where id=" & Request("id")
rs.open strsql,conn,1,1
Response.BinaryWrite rs("image").GetChunk(7500000)
rs.Close
Set rs=nothing
Set conn=nothing
%> 展开
1个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询