SPSite.Delete 方法

Deletes the site collection from the server.

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

语法

声明
Public Sub Delete
用法
Dim instance As SPSite

instance.Delete()
public void Delete()

示例

The following code example illustrates how to use the Delete method.

Dim siteCollection As New SPSite("http://" + 
    System.Environment.MachineName + "/sites/Site_Collection")

siteCollection.Delete()
siteCollection.Dispose()
SPSite oSiteCollection = new SPSite("http://" + 
    System.Environment.MachineName + "/sites/Site_Collection");

oSiteCollection.Delete();
oSiteCollection.Dispose();

备注

Certain objects implement the IDisposable interface, and you must avoid retaining these objects in memory after they are no longer needed. For information about good coding practices, see Disposing Objects.

另请参阅

引用

SPSite 类

SPSite 成员

Delete 重载

Microsoft.SharePoint 命名空间