![]() |
购物专题 | 基金专题 | 性专题 | 饮食专题 | 教育专题 | 生活大参考 | 园林资讯 | 园艺库 | 健康专题 | |
| 论文专题 | 家庭养花 | 园林景观 | 盆景奇石 | 激情图库 | 农业资料库 | 园林古建 | 英文站 | 花卉栽培 |
我要在网站的文件夹里建立一个存放html新闻的文件夹,用相对路径建立
---------------------------------------------------------------
server.mappath("../html/") 转换成实际地址再建立
---------------------------------------------------------------
’===================================================================================
’ 函数原型: BuildPath(sPath)
’ 功 能: 根据指定的路径创建目录
’ 参 数: sPath URL模板
’ 返 回 值: 如果成功,返回空字符串,否则返回错误信息和错误位置
’===================================================================================
Public Function BuildPath (sPath)
Dim iCnt
Dim path
Dim BasePath
path=Split(sPath,"/")
If Left(sPath,1)="/" Or Left(sPath,1)="\" Then
BasePath=Server.MapPath("/")
Else
BasePath=Server.MapPath(".")
End If
Dim cPath,oFso
cPath=BasePath
BuildPath=""
Set oFso=Server.Createobject("Scripting.FileSystemObject")
For iCnt=LBound(path) To UBound(path)
If Trim(path(iCnt))<>"" Then
cPath=cPath & "\" & Trim(path(iCnt))
If Not oFso.FolderExists(cPath) Then
On Error Resume Next
oFso.CreateFolder cPath
If Err.Number<>0 Then
BuildPath=Err.Description & "[" & cPath & "]"
Exit For
End If
On Error Goto 0
End If
End If
Next
Set oFso=Nothing
End Function
浙ICP备 :07003766号 Copyright © 2001-2007 JUBAO163,All rights reserved. |