下面两个文件 :
<!-#enthalten virtual =/Ints/Chunfeng/graphicDeTect.asp->
<html>
<kopf>
<title> 图像尺寸 </title>
</head>
<Body Bgcolor =#ffffff>
<%
Graphic = Images/Ints.gif
HW = ReadImg (Grafik)
Antwort.
& <br>
response.write <img src =/ & graphic &
Antwort.Write Height = & HW (0) &
Antwort.Write width = & hw (0) &>
%>
</body>
</html>
------------------------
GraphicDeTect.asp
<%
Dim HW
Funktion ASCAT (s, n)
ASCAT = ASC (Mid (s, n, 1))
Endfunktion
Funktion hexat (s, n)
Hexat = hex (ascat (s, n))
Endfunktion
Funktion ISJPG (Fichero)
Wenn instr (uCase (Fichero), .jpg) <> 0 dann
isjpg = true
Anders
isjpg = false
Ende wenn
Endfunktion
Funktion ISPNG (Fichero)
Wenn instr (uCase (Fichero), .png) <> 0 dann
ispng = true
Anders
ispng = false
Ende wenn
Endfunktion
Funktion ISGIF (Fichero)
Wenn Instrument (uCase (Fichero), .gif) <> 0 dann dann
isgif = true
Anders
isgif = false
Ende wenn
Endfunktion
Funktion ISBMP (Fichero)
Wenn Instrument (uCase (Fichero), .bmp) <> 0 dann dann
isbmp = true
Anders
isbmp = false
Ende wenn
Endfunktion
Funktion ISWMF (Fichero)
Wenn instr (uCase (Fichero), .wmf) <> 0 dann
iswmf = true
Anders
iswmf = false
Ende wenn
Endfunktion
Funktion ISWebimg (f)
Wenn ISGIF (F) oder ISJPG (F) oder ISPNG (F) oder ISBMP (F) oder ISWMF (F)
Dann
iswebimg = true
Anders
iswebimg = true
Ende wenn
Endfunktion
Funktion Readimg (Fichero)
Wenn isgif (Fichero) dann
ReadImg = Readgif (Fichero)
Anders
Wenn isjpg (Fichero) dann
ReadImg = Readjpg (Fichero)
Anders
Wenn ispng (Fichero) dann
ReadImg = ReadPng (Fichero)
Anders
Wenn ISBMP (Fichero) dann
ReadImg = ReadPng (Fichero)
Anders
Wenn iswmf (Fichero) dann
ReadImg = ReadWmf (Fichero)
Anders
ReadImg = Array (0,0)
Ende wenn
Ende wenn
Ende wenn
Ende wenn
Ende wenn
Endfunktion
Funktion readjpg (Fichero)
Dim FSO, TS, S, HW, NBYTES
Hw = array (,)
Setzen Sie fso = createObject (scripting.filesystemObject)
Setzen Sie ts = fso.opentextfile (server.mappath (/ & fichero), 1)
s = rechts (ts.read (167), 4)
Hw (0) = hextodec (hexat (s, 3) & hexat (s, 4))
Hw (1) = hextodec (hexat (s, 1) & hexat (s, 2))
ts.close
Readjpg = HW
Endfunktion
Funktion ReadPng (Fichero)
Dim FSO, TS, S, HW, NBYTES
Hw = array (,)