下面两个文件 :
<!-#incluye virtual =/Intels/Chunfeng/GraphicDetect.asp->
<html>
<Evista>
<title> 图像尺寸 </title>
</ablo>
<Body bgcolor =#ffffff>
<%
gráfico = imágenes/Intels.gif
Hw = readimg (gráfico)
Response.Rite Graphic & Dimensions: & HW (0) & X & HW (1)
& <br>
Response.Write <img src =/ & graphic &
Response.Write Height = & HW (0) y
Response.Write Width = & HW (0) &>
%>
</body>
</html>
------------------------
GraphicDetect.asp
<%
Dim HW
Función ascat (s, n)
ASCAT = ASC (Mid (S, N, 1))
Función final
Función hexat (s, n)
Hexat = hex (ascat (s, n))
Función final
Función ISJPG (Fichero)
Si Instr (ucase (fichero), .jpg) <> 0 entonces
isjpg = verdadero
Demás
ISJPG = falso
Final si
Función final
Función ispng (fichero)
Si Instr (ucase (fichero), .png) <> 0 entonces
ispng = verdadero
Demás
ispng = falso
Final si
Función final
Función isgif (fichero)
If instrer (ucase (fichero), .gif) <> 0 entonces
isgif = verdadero
Demás
isgif = falso
Final si
Función final
Función ISBMP (Fichero)
If Instr (ucase (fichero), .bmp) <> 0 entonces
ISBMP = True
Demás
ISBMP = falso
Final si
Función final
Función ISWMF (Fichero)
Si Instr (ucase (fichero), .wmf) <> 0 entonces
iswmf = verdadero
Demás
iswmf = falso
Final si
Función final
Función iswebimg (f)
If isgif (f) o isjpg (f) o ispng (f) o isbmp (f) o iswmf (f)
Entonces
iswebimg = verdadero
Demás
iswebimg = verdadero
Final si
Función final
Función readimg (fichero)
If isgif (fichero) entonces
Readimg = readGif (fichero)
Demás
Si isjpg (fichero) entonces
Readimg = readJpg (Fichero)
Demás
If ispng (fichero) entonces
Readimg = readpng (fichero)
Demás
If isbmp (fichero) entonces
Readimg = readpng (fichero)
Demás
Si iswmf (fichero) entonces
Readimg = readwmf (fichero)
Demás
Readimg = array (0,0)
Final si
Final si
Final si
Final si
Final si
Función final
Función readjpg (fichero)
Dim FSO, TS, S, HW, Nbytes
Hw = array (,)
Establecer fso = createObject (scripting.filesystemObject)
Establecer ts = fso.opentextfile (server.mappath (/ & fichero), 1)
S = Right (ts.Read (167), 4)
HW (0) = Hextodec (Hexat (S, 3) y Hexat (S, 4))
Hw (1) = Hextodec (Hexat (s, 1) y hexat (s, 2))
tshlose
Readjpg = hw
Función final
Función readpng (fichero)
Dim FSO, TS, S, HW, Nbytes
Hw = array (,)