<!--#include file="../user/connect.asp"-->
<%
Dim pos,rpos,poster
pos="select top 4 * from poster where knot='0' and statuss='1' order by id desc "
Set rpos=Server.CreateObject("ADODB.Recordset")
rpos.open pos,con
poster=0
While Not rpos.EOF
Dim FileName,OutFormat
FileName = rpos.fields("pfile").value <------หากไม่ใช่จาก database จะมองเห็นค่า width height
OutFormat = "Jpg" '*** Gif,Png ***'
'*** Get Images Width & Height ***'
Dim objFso,myImg,Width,Height
Set objFso = CreateObject("Scripting.FileSystemObject")
IF objFso.FileExists(Server.MapPath(FileName)) Then
set myImg = Loadpicture(Server.MapPath(FileName))
Width = Round(myImg.width / 26.4583)
Height = Round(myImg.height / 26.4583)
End If
Response.write("file"+FileName+"<br>"+Width+Height)
Response.write(rpos.fields("pfile").value+"<br>"+Width+Height)
rpos.movenext
Wend
%>
IF objFso.FileExists(Server.MapPath(FileName)) Then
set myImg = Loadpicture(Server.MapPath(FileName))
Width = Round(myImg.width / 26.4583)
Height = Round(myImg.height / 26.4583)
End If