Метод 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