SPFolderCollection.Delete 方法

删除文件夹位于集合中指定的 URL。

命名空间:  Microsoft.SharePoint
程序集:  Microsoft.SharePoint(位于 Microsoft.SharePoint.dll 中)

语法

声明
Public Sub Delete ( _
    strUrl As String _
)
用法
Dim instance As SPFolderCollection
Dim strUrl As String

instance.Delete(strUrl)
public void Delete(
    string strUrl
)

参数

  • strUrl
    类型:System.String

    一个字符串,指定的 URL。

备注

此方法删除位于文件夹集合,从strUrl参数所指定的 URL 的文件夹,并设置为已修改集合的父文件夹。

示例

此代码示例删除指定的子网站的文件夹。

Dim siteCollection As SPSite = SPControl.GetContextSite(Context)
Dim folders As SPFolderCollection = 
    siteCollection.AllWebs("Site_Name").Folders

folders.Delete("Folder_Name") 
SPSite oSiteCollection = SPContext.Current.Site;

SPFolderCollection collFolders = 
    oSiteCollection.AllWebs["Site_Name"].Folders;

collFolders.Delete("Folder_Name");

另请参阅

引用

SPFolderCollection 类

SPFolderCollection 成员

Microsoft.SharePoint 命名空间