<%
'返回一个路径串变量
Public function root()
	root=Request.ServerVariables("Appl_Physical_path")
end function

'创建一个目录并返回信息
Public function mkdir(xVar)
	Dim fso,msg
	Set fso = CreateObject("Scripting.FileSystemObject")
	if fso.folderExists(xVar) Then
		msg="抱歉，该目录已存在！"
	else
		fso.CreateFolder(xVar)		
		msg="恭喜，目录创建成功！"
	end if
	set fso=nothing
	mkdir=msg
end function

'删除一个目录并返回信息
Public function deldir(xVar)
	Dim fso,msg
	Set fso = CreateObject("Scripting.FileSystemObject")
	if fso.folderExists(xVar) Then
		fso.DeleteFolder(xVar)		
		msg="恭喜，目录删除成功！"
	else
		msg="抱歉，该目录还未被创建！"
	end if
	set fso=nothing
	deldir=msg
end function

'检查一个目录是否存在并返回信息
Public function isdir(xVar)
	Dim fso,msg
	Set fso = CreateObject("Scripting.FileSystemObject")
	if fso.folderExists(xVar) Then		
		msg=True
	else
		msg=false
	end if
	set fso=nothing
	isdir=msg
end function

'复制文件夹并返回信息
Public function cpdir(xVar,yVar,zVar)
	Dim fso,msg
	Set fso = CreateObject("Scripting.FileSystemObject")
	if fso.folderExists(xVar) Then
	fso.CopyFolder xVar,yVar,zVar		
		msg="恭喜，目录复制成功！"
	else
		msg="抱歉，没有找到您想要的目录！"
	end if
	set fso=nothing
	cpdir=msg
end function

function delfile(str)
	Dim fso,msg
	Set fso = CreateObject("Scripting.FileSystemObject")
	if fso.FileExists(str) then
		fso.DeleteFile str
		msg="恭喜，文件删除成功！"
	else
		msg="抱歉，文件删除失败！"
	end if
	set fso=nothing
	delfile=msg
end function
%>