Share via


刪除物件的子樹狀結構

若要刪除項目和其所有子項,請呼叫 DeleteTree 方法。DeleteTree 方法會從階層中刪除目前的項目和其所有子樹狀結構項目。

下列程式碼片段示範如何從目錄中移除物件的樹狀結構。

Dim entry As New DirectoryServices.DirectoryEntry( _
               "LDAP://Fabrikam.com/cn=MyContainer,dc=Fabrikam,dc=com")
entry.DeleteTree()
System.DirectoryServices.DirectoryEntry entry = 
   new System.DirectoryServices.DirectoryEntry(
            "LDAP://Fabrikam.com/cn=MyContainer,dc=Fabrikam,dc=com");
entry.DeleteTree();

請參閱

參考

System.DirectoryServices
DirectoryEntry

概念

刪除目錄物件

Send comments about this topic to Microsoft.

Copyright © 2007 by Microsoft Corporation.All rights reserved.