在VB中中止FileSystemObject的Delete方法

发表于:2007-06-17来源:作者:点击数: 标签:
A caveat for the FileSystemObject Delete methods in Visual Basic As you know, the Microsoft Scripting Runtime object library makes it easy to manipulate files and folders. With the DeleteFolder and DeleteFile methods, you can eliminate unw

   
  A caveat for the FileSystemObject Delete methods in Visual Basic

As you know, the Microsoft Scripting Runtime object library makes it easy to manipulate files and folders. With the DeleteFolder and DeleteFile methods, you can eliminate unwanted items. However, these methods will abort if they encounter an error--and they don注释:t rollback the changes they made up to that point. For instance, if a method deletes two folders out of ten and an error oclearcase/" target="_blank" >ccurs, Visual Basic aborts the operation and only the first two items will have been deleted. Several FileSystemObject methods operate this way.

原文转自:http://www.ltesting.net