SPUser.Email 属性

Gets or sets the e-mail address of the user. (Read-only in 沙盒解决方案.)

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

语法

声明
Public Property Email As String
    Get
    Set
用法
Dim instance As SPUser
Dim value As String

value = instance.Email

instance.Email = value
public string Email { get; set; }

属性值

类型:System.String
A string that contains the e-mail address.

备注

To modify the e-mail address for a user by setting the value of the Email property, call the Update method to effect the changes in the database.

示例

The following code example modifies the e-mail address for a specified user object.

Dim siteCollection As SPSite = SPControl.GetContextSite(Context)
Dim site As SPWeb = siteColl.AllWebs("Site_Name")
Dim user As SPUser = site.AllUsers("User_Name")

user.Email = "E-mail_Address"

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.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.

另请参阅

引用

SPUser 类

SPUser 成员

Microsoft.SharePoint 命名空间