日期:2014-05-17  浏览次数:20864 次

关于图片的问题,急等高手解答!!!
问个问题啊,我从数据库读出一段代码,用response.write输出
是 <img   src=c:\1.jpg> </img>
也就是显示一个图片,用什么方法可以输出图象呢
在线等,希望高手指导下!!!!

------解决方案--------------------
如果你在数据库中存储的是数据库路径,可以使用Response.Write,如:
Response.Write " <img src= " & Rs( "imgPath ") & " border=0> "

如果存储的是二进制图片,那就要使用Response.BinaryWrite了,如:
Response.ContentType= "image/* "
Response.BinaryWrite Rs( "img ")
------解决方案--------------------
<%
function ReplaceTagChar(strin)

strin = Replace(strin, "&amp; " , "& ")
strin = Replace(strin, "&lt; ", " < " )
strin = Replace(strin, "&gt; " , "> " )
strin = Replace(strin, "&quot; " , "\ " )
strin = Replace(strin, "&nbsp; " , " " )

ReplaceTagChar= strin
End function


str= "&lt;img&nbsp;src=c:\1.jpg&gt;&lt;/img&gt; "

str=ReplaceTagChar(str)

response.write(str)
%>