SPWeb.Update method
Namespace: Microsoft.SharePoint
Assembly: Microsoft.SharePoint (in Microsoft.SharePoint.dll)
Syntax
'宣告
Public Sub Update
'用途
Dim instance As SPWeb
instance.Update()
public void Update()
備註
如果任何SPWeb物件的屬性值已變更,此方法會儲存到資料庫的所有屬性的值。
Examples
下列程式碼範例會使用Update方法來變更目前的網站集合中指定的站台的標題。
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();
}
![]() |
---|
某些物件實作IDisposable介面,並且您必須避免之後不再需要保留這些物件在記憶體中。良好的程式碼撰寫方式的相關資訊,請參閱Disposing Objects。 |