SPFile.CanOpenFile method (Boolean)

Indicates whether the current user has permission to view the content of the file, specifying a level of access.

Namespace:  Microsoft.SharePoint
Assembly:  Microsoft.SharePoint (in Microsoft.SharePoint.dll)

Syntax

'Declaration
Public Function CanOpenFile ( _
    checkCanGetFileSource As Boolean _
) As Boolean
'Usage
Dim instance As SPFile
Dim checkCanGetFileSource As Boolean
Dim returnValue As Boolean

returnValue = instance.CanOpenFile(checkCanGetFileSource)
public bool CanOpenFile(
    bool checkCanGetFileSource
)

Parameters

  • checkCanGetFileSource
    Type: System.Boolean

    true to verify that the user can view the source for the file; otherwise, false.

Return value

Type: System.Boolean
true if the current user has permission; otherwise, false.

See also

Reference

SPFile class

SPFile members

CanOpenFile overload

Microsoft.SharePoint namespace