小叶白龙 博客

 

 ASP经典代码,文件夹重命名

本站整理, 发表于:2010-07-16 12:24:24, 分类:技术文章 浏览( ) 评论( )  收藏这篇日志

<%

Name1="原文件名"
Name2="目标文件名"

if Name1<>"" and Name2<>"" then

Sub RenameFolder(ByVal strFolderPath, ByVal strNewName)

Dim objFileSystem
Set objFileSystem=Server.CreateObject("Scripting.FileSystemObject")

' 如果路径不包含冒号, 则认为 strFolderPath 是虚拟路径.
' 故调用 Server.MapPath() 方法将此路径转为绝对路径
If Instr(1,strFolderPath,":")=-1 Then
strFolderPath=Server.MapPath(strFolderPath)
End If

Dim objFolder
Set objFolder=objFileSystem.GetFolder(strFolderPath)
objFolder.Name=strNewName

Set objFolder=nothing
Set objFileSystem=nothing

End Sub

RenameFolder Server.MapPath(Name1),Name2
response.write "已经成功地把 "+Name1+" 更名为 "+Name2+" !"

end if

%>

正在读取日志的评论数据,请稍后……
正在加载日志评论签写框,请稍后……
成员登录通道
正在载入成员登录通道...
BLOG 日历助手
正在载入日历助手...
BLOG 统计信息
正在载入统计信息...
BLOG 日志归档
BLOG 最新评论
{$SideComment}
BLOG 最新留言
{$SideGB}
BLOG 站内搜索

BLOG 友情链接

Copyright © 2009-2011 xiaoyebailong.com. All Rights Reserved.

程序运行时间:毫秒

京ICP备09037676号