SPFile.CanOpenFile method (Boolean, String)
表示目前使用者是否有檢視的檔案內容的權限指定存取層級以及用來接收 ETag 輸出變數。
Namespace: Microsoft.SharePoint
Assembly: Microsoft.SharePoint (in Microsoft.SharePoint.dll)
Syntax
'宣告
Public Function CanOpenFile ( _
checkCanGetFileSource As Boolean, _
<OutAttribute> ByRef eTag As String _
) As Boolean
'用途
Dim instance As SPFile
Dim checkCanGetFileSource As Boolean
Dim eTag As String
Dim returnValue As Boolean
returnValue = instance.CanOpenFile(checkCanGetFileSource, _
eTag)
public bool CanOpenFile(
bool checkCanGetFileSource,
out string eTag
)
參數
checkCanGetFileSource
Type: System.Boolean若要確認使用者可以檢視來源檔案 ; true否則, false。
eTag
Type: System.String此變數會接收的雜湊戳記可識別的檔案版本的參考。如果使用者沒有權限開啟檔案,該變數會接收 null 值。
傳回值
Type: System.Boolean
true如果目前的使用者具有權限 ;否則, false。
備註
您可以呼叫這個方法之前呼叫OpenBinaryStream(SPOpenBinaryOptions, String, String)方法。