用户登录  |  用户注册
首 页商业源码原创产品编程论坛
当前位置:PB创新网文章中心编程技巧Delphi

用ASP程序来删除指定的文件或文件夹

减小字体 增大字体 作者:佚名  来源:本站整理  发布时间:2009-03-16 20:15:49
DeleteFolder Method<br>
Deletes a specified folder and its contents.<br>
<br>
object.DeleteFolder folderspec[, force] <br>
<br>
Arguments <br>
object<br>
<br>
Required. Always the name of a FileSystemObject.<br>
<br>
folderspec<br>
<br>
Required. The name of the folder to delete. The folderspec can contain wildcard characters in the last path component.<br>
<br>
force<br>
<br>
Optional. Boolean value that is True if folders with the read-only attribute set are to be deleted; False (default) if they are not.<br>
<br>
Remarks<br>
The DeleteFolder method does not distinguish between folders that have contents and those that do not. The specified folder is deleted regardless of whether or not it has contents. <br>
<br>
An error occurs if no matching folders are found. The DeleteFolder method stops on the first error it encounters. No attempt is made to roll back or undo any changes that were made before an error occurred.<br>
<br>
The following example illustrates use of the DeleteFolder method: <br>
<br>
Sub DeleteAFolder(filespec)<br>
   Dim fso<br>
   Set fso = CreateObject("Scripting.FileSystemObject")<br>
   fso.DeleteFolder(filespec)<br>
End Sub<br>
DeleteFile Method<br>
Deletes a specified file.<br>
<br>
object.DeleteFile filespec[, force] <br>
<br>
Arguments <br>
object<br>
<br>
Required. Always the name of a FileSystemObject.<br>
<br>
filespec<br>
<br>
Required. The name of the file to delete. The filespec can contain wildcard characters in the last path component.<br>
<br>
force<br>
<br>
Optional. Boolean value that is True if files with the read-only attribute set are to be deleted; False (default) if they are not.<br>
<br>
Remarks<br>
An error occurs if no matching files are found. The DeleteFile method stops on the first error it encounters. No attempt is made to roll back or undo any changes that were made before an error occurred.<br>
<br>
The following example illustrates use of the DeleteFile method: <br>
<br>
Sub DeleteAFile(filespec)<br>
   Dim fso<br>
   Set fso = CreateObject("Scripting.FileSystemObject")<br>
   fso.DeleteFile(filespec)<br>
End Sub<br>

Tags:

作者:佚名

文章评论评论内容只代表网友观点,与本站立场无关!

   评论摘要(共 0 条,得分 0 分,平均 0 分) 查看完整评论
PB创新网ourmis.com】Copyright © 2000-2009 . All Rights Reserved .
页面执行时间:13,046.88000 毫秒
Email:ourmis@126.com QQ:2322888 蜀ICP备05006790号