内容显示页
 
类别:ASP+VBS | 浏览(199) | 2006-8-2 10:31:00

'文件是否存在的函数

Function fileexits(filename)
set FSO=Server.CreateObject("Scripting.FileSystemObject")
If FSO.FileExists(filename) Then
   fileexits=true
Else
   fileexits=false
End If
end Function

'得到文件的width 和height

        picurl="uploadfile/"&rs("pic")
        picurl=server.mappath(picurl)

        if fileexits(picurl) then
        set myImg = loadpicture(picurl)
        iWidth = round(myImg.width / 26.4583)
        iHeight = round(myImg.height / 26.4583)
        else
        picurl="images/kong.gif"
        end if

'图片调用

<img src="uploadfile/<%=rs("pic")%> "     <%if iwidth<=113 and iheight<=113 then
          elseif iwidth>=iheight then
          response.write " width=113"
          else
          response.write " height=113"
          end if
          %> border="0">


引用本页地址:http://www.yongfa365.com/item/d13917bd7aac9504.html
 
 
相关链接
 
网友评论:
姓名: 记住我
网址:
邮箱:
内容:
验证码:  验证码图片 看不清? 换张图试试
 
     
 
 
文章分类
 
 
专题(3)
 
.Net + C#(41)
 
ASP+VBS(153)
 
 
 
Linux(10)
 
 
 
web 2.0(24)
 
 
 
 
 
心程(59)
 
生活(80)
 
 
     

Power by :柳永法(yongfa365)'Blog | Model by :hibaidu | CSS by:众网友 | 京ICP备07011491号  QQ:64049027  E-mail:64049027qq.com

本空间赞助商:北京中科兴联信息技术有限公司