asp fso创建文件夹(郁闷)
用fso建立文件夹用于生成html(在News文件夹下生成日期文件夹)setfso=server.CreateObject("Scripting.FileSystemOb...
用fso建立文件夹用于生成html(在News文件夹下生成日期文件夹)
set fso = server.CreateObject("Scripting.FileSystemObject")
folder = "News/"&date()&"/" '这句报错
folder = "News/" '这句没错
folder = date()&"/" '也没有错
fso.CreateFolder(Server.MapPath(folder))
为什么folder = "News/"&date()&"/" 会有错,提示路径未找到???郁闷 展开
set fso = server.CreateObject("Scripting.FileSystemObject")
folder = "News/"&date()&"/" '这句报错
folder = "News/" '这句没错
folder = date()&"/" '也没有错
fso.CreateFolder(Server.MapPath(folder))
为什么folder = "News/"&date()&"/" 会有错,提示路径未找到???郁闷 展开
2个回答
展开全部
<%
function CheckFolder(path)
Set fs = Server.CreateObject("Scripting.FileSystemObject")
If fs.FolderExists(Server.MapPath(path)) = true Then
return true
Else
return false
End If
end function
function CreateFolder(path)
If CheckFolder(path) = false Then
fso.CreateFolder(Server.MapPath(path))
End If
end function
folder = date()&"/"
CreateFolder("/News/")
CreateFolder("News/"&date()&"/")
%>
function CheckFolder(path)
Set fs = Server.CreateObject("Scripting.FileSystemObject")
If fs.FolderExists(Server.MapPath(path)) = true Then
return true
Else
return false
End If
end function
function CreateFolder(path)
If CheckFolder(path) = false Then
fso.CreateFolder(Server.MapPath(path))
End If
end function
folder = date()&"/"
CreateFolder("/News/")
CreateFolder("News/"&date()&"/")
%>
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询