SPWeb.Update 方法

Updates the database with changes that are made to the website.

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

语法

声明
Public Sub Update
用法
Dim instance As SPWeb

instance.Update()
public void Update()

备注

If the value of any of the properties of the SPWeb object has changed, this method saves the values of all properties to the database.

示例

The following code example uses the Update method to change the title of a specified site in the current site collection.

Using webSite As SPWeb = SPContext.Current.Site.OpenWeb("Site_Name")
    webSite.Title = "New_Site_Name"
    webSite.Update()
End Using
using (SPWeb oWebsite = SPContext.Current.Site.OpenWeb("Website_URL"))
{
    oWebsite.Title = "My New Title";
    oWebsite.Update();
}

备注

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.

另请参阅

引用

SPWeb 类

SPWeb 成员

Microsoft.SharePoint 命名空间

AllProperties