中华考试网·阅读新闻
编程开发 > ASP > 文章内容

ASP编程教程技巧综合大全(4)

2015-7-6编辑:ljnbset

Public function AppName()
''取当前程序名称
AppName = Mid(Request.ServerVariables("SCRIPT_NAME"),(InStrRev(Request.ServerVariables("SCRIPT_NAME") ,"/",-1,1))+1,Len(Request.ServerVariables("SCRIPT_NAME")))
End Function

Public function DeleteFile(filespec)
''删除一个文件
Dim fso
Set fso = CreateObject("Scripting.FileSystemObject")
If Err.number<>0 Then
Response.Write("删除文件发生错误!请查看错误信息
" & Err.number & "
" & Err.Description)
Err.Clear
DeleteFile = False
End If
call fso.DeleteFile(filespec)
Set fso = Nothing
DeleteFile = True
End function

ASP编程教程技巧综合大全(3)
咨询热线:4000-525-585(免长途费)