当前位置: 首页 > 网络学院 > 服务端脚本教程 > ASP > ASP DeleteFile 方法

ASP
ASP 介绍
ASP Install
ASP 语法
ASP 变量
ASP Procedures
ASP Forms
ASP Cookies
ASP Session
ASP Application
ASP #include
ASP Global.asa
ASP Send e-mail
ASP Response
ASP Request
ASP Application
ASP Session
ASP Server
ASP Error
ASP FileSystem
ASP TextStream

ASP DeleteFile 方法


出处:互联网   整理: 软晨网(RuanChen.com)   发布: 2009-03-04   浏览: 301 ::
收藏到网摘: n/a

The DeleteFile method deletes one or more specified files.
DeleteFile的作用是删除一个或多个指定的文件

Note: An error will occur if you try to delete a file that doesn't exist.
注意:如果你试图删除一个不存在的文件的话将导致错误产生。

Syntax
语法

FileSystemObject.DeleteFile(filename[,force])

Parameter参数 Description描述
filename Required. The name of the file or files to delete (Wildcards are allowed)
必要组件。设定需要被删除的文件的名称(可以使用通配符)
force Optional. A Boolean value that indicates whether read-only files will be deleted. True indicates that the read-only files will be deleted, False indicates that they will not be deleted. Default is False
可选组件。它是一个逻辑值,用于设定是否可以删除只读格式(read-only)的文件。如果值为“true真”,则可以删除;如果是“false假”,则不可以删除。默认时为:false假。

Example
举例

<%
dim fs
Set fs=Server.CreateObject("Scripting.FileSystemObject")
fs.CreateTextFile("c:test.txt",True)
if fs.FileExists("c:test.txt") then fs.DeleteFile("c:test.txt")
end if
set fs=nothing
%>

评论 (0) All

登陆 | 还没注册?