方法一:使用 ASP FileSystemObject 对象
<%
Set fs=Server.CreateObject("Scripting.FileSystemObject")
Response.Write("文件的文件扩展名是:")
Response.Write(fs.GetExtensionName("d:\file\abc.jpg"))
set fs=nothing
%>方法二:使用 mid 与instrrev 函数
<%
filename="d:\file\abc.jpg"
kzm=Mid(filename,InStrRev(filename,".")+1)'使用时把中文括号改变为英文括号
Response.Write("文件的文件扩展名是:"&kzm)
%>