Partilhar via


SPWeb.CurrentUser Property

Gets the current user of the site.

Namespace:  Microsoft.SharePoint
Assembly:  Microsoft.SharePoint (in Microsoft.SharePoint.dll)
Available in Sandboxed Solutions: Yes
Available in SharePoint Online

Syntax

'Declaration
<ClientCallableAttribute> _
<ClientCallableConstraintAttribute(Type := ClientCallableConstraintType.NotNull)> _
Public ReadOnly Property CurrentUser As SPUser
    Get
'Usage
Dim instance As SPWeb
Dim value As SPUser

value = instance.CurrentUser
[ClientCallableAttribute]
[ClientCallableConstraintAttribute(Type = ClientCallableConstraintType.NotNull)]
public SPUser CurrentUser { get; }

Property Value

Type: Microsoft.SharePoint.SPUser
An SPUser object that represents the current user.

See Also

Reference

SPWeb Class

SPWeb Members

Microsoft.SharePoint Namespace