photo.inc

来自「物业管理和办公自动化系统」· INC 代码 · 共 18 行

INC
18
字号
<%
Function GetPhoto(pEmpSerial)
	dim sPhoto	 :	sPhoto = "photo/" & pEmpSerial & ".gif"

	'' 映射成物理路经
	sPhoto = left(Request.ServerVariables("PATH_TRANSLATED"), instrrev(Request.ServerVariables("PATH_TRANSLATED"),"\")) & "photo\" & pEmpSerial & ".gif"

	'' 判断文件是否存在,如果存在,则显示图片,否则显示“照片尚为上传”
	dim fso	: set fso = createobject("Scripting.FileSystemObject")	' 首先建立fileSystemObject对象
	if fso.FileExists(sPhoto) then		' 然后使用FileExists()判断文件是否存在
		sPhoto = "photo/" & pEmpSerial & ".gif"
		sPhoto = "<img border=0 width=85 height=110 src=""" & sPhoto & """>"	' 文件存在
	else
		sPhoto = "照片尚未上传"		' 文件不存在
	end if
	GetPhoto = sPhoto
End Function
%>

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?