SPUser.Notes property
取得或設定使用者的備忘稿。
Namespace: Microsoft.SharePoint
Assembly: Microsoft.SharePoint (in Microsoft.SharePoint.dll)
Syntax
'宣告
Public Property Notes As String
Get
Set
'用途
Dim instance As SPUser
Dim value As String
value = instance.Notes
instance.Notes = value
public string Notes { get; set; }
Property value
Type: System.String
字串,包含備忘稿。
備註
若要修改的使用者附註藉由設定Notes屬性的值,呼叫Update方法來影響資料庫中的變更。
Examples
下列程式碼範例會修改指定的使用者物件的附註。
Dim siteCollection As SPSite = SPControl.GetContextSite(Context)
Dim site As SPWeb = siteColl.AllWebs("Site_Name")
Dim user As SPUser = site.AllUsers("User_Name")
user.Notes = "User_Notes"
user.Update()
SPSite oSiteCollection = SPContext.Current.Site;
using(SPWeb oWebsite = oSiteCollection.AllWebs["Website_Name"])
{
SPUser oUser = oWebsite.AllUsers["User_Name"];
oUser.Email = " E-mail_Address";
oUser.Name = " Display_Name";
oUser.Notes = " User_Notes";
oUser.Update();
}
注意事項 |
---|
某些物件實作IDisposable介面,並且您必須避免之後不再需要保留這些物件在記憶體中。良好的程式碼撰寫方式的相關資訊,請參閱Disposing Objects。 |