'------------------------------------------- '函數名:chkimg '作 用:檢查圖片文件是否合法 '參 數:img,圖片路徑 '返回值:布爾類型 '條 件:服務器必須支持AspJpeg '------------------------------------------- Function chkimg(img) on error resume Next chkimg=True if isnull(img) then chkimg=false:exit function Set chkJpeg = Server.CreateObject("Persits.Jpeg") chkPath = Server.mappath(img) chkJpeg.Open chkPath If Err Then chkimg=False End If If err.number>0 Then err.clear Set chkjpeg=Nothing End Function