共用方式為


SPFile.SaveBinary method (Stream, Boolean, Boolean, String, String, Stream, String)

將儲存的檔案和檔案格式的中繼資料根據指定的資料流、 字串和選擇性的ETag值。

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

Syntax

'宣告
Public Sub SaveBinary ( _
    file As Stream, _
    checkRequiredFields As Boolean, _
    createVersion As Boolean, _
    etagMatch As String, _
    lockIdMatch As String, _
    fileFormatMetaInfo As Stream, _
    <OutAttribute> ByRef etagNew As String _
)
'用途
Dim instance As SPFile
Dim file As Stream
Dim checkRequiredFields As Boolean
Dim createVersion As Boolean
Dim etagMatch As String
Dim lockIdMatch As String
Dim fileFormatMetaInfo As Stream
Dim etagNew As String

instance.SaveBinary(file, checkRequiredFields, _
    createVersion, etagMatch, lockIdMatch, _
    fileFormatMetaInfo, etagNew)
public void SaveBinary(
    Stream file,
    bool checkRequiredFields,
    bool createVersion,
    string etagMatch,
    string lockIdMatch,
    Stream fileFormatMetaInfo,
    out string etagNew
)

參數

  • checkRequiredFields
    Type: System.Boolean

    Boolean值,這個值指定是否應該儲存檔案之前檢查必要的欄位。

    true來檢查必要的欄位時儲存檔案。否則, false。

  • createVersion
    Type: System.Boolean

    指定儲存檔案時,就建立新版本的Boolean值。這只會版本控制已啟用,且適用於這份文件。若要強制建立新版本的檔案時儲存 ; true否則, false。請注意,設定false這個參數會導致發生的預設行為。

  • etagMatch
    Type: System.String

    如果不只儲存a null reference (Nothing in Visual Basic),然後檔案如果此字串符合目前SPFile.ETag的檔案。

  • lockIdMatch
    Type: System.String

    如果a null reference (Nothing in Visual Basic)檔案,沒有鎖定再檔案儲存在值是否符合目前的SPFile.LockId時,才會成功。共用鎖定,這個值必須指定為相同時才會成功。如需有關共用鎖定的詳細資訊,請參閱SPFile.SPLockType列舉型別。

  • fileFormatMetaInfo
    Type: System.IO.Stream

    System.IO.Stream物件,包含檔案格式的中繼資料。

  • etagNew
    Type: System.String

    這個方法傳回時,包含新開啟檔案的ETagString 。這個參數會傳遞未初始化。

請參閱

參照

SPFile class

SPFile members

SaveBinary overload

Microsoft.SharePoint namespace