共用方式為


SPFile.OpenBinaryStream Method (SPOpenBinaryOptions, String, String)

Opens the file as a stream based on the specified options.

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

Syntax

'Declaration
<SubsetCallableExcludeMemberAttribute(SubsetCallableExcludeMemberType.UnsupportedSPType)> _
Public Function OpenBinaryStream ( _
    openOptions As SPOpenBinaryOptions, _
    etagNotMatch As String, _
    <OutAttribute> ByRef etagNew As String _
) As Stream
'Usage
Dim instance As SPFile
Dim openOptions As SPOpenBinaryOptions
Dim etagNotMatch As String
Dim etagNew As String
Dim returnValue As Stream

returnValue = instance.OpenBinaryStream(openOptions, _
    etagNotMatch, etagNew)
[SubsetCallableExcludeMemberAttribute(SubsetCallableExcludeMemberType.UnsupportedSPType)]
public Stream OpenBinaryStream(
    SPOpenBinaryOptions openOptions,
    string etagNotMatch,
    out string etagNew
)

Parameters

  • etagNotMatch
    Type: System.String

    The ETag value to use for not match. If a null reference (Nothing in Visual Basic), the file is always opened. If not a null reference (Nothing in Visual Basic) and the match operation fails, an exception is thrown.

  • etagNew
    Type: System.String

    When this method returns, contains a String that is the ETag value of the newly opened file. This parameter is passed uninitialized.

Return Value

Type: System.IO.Stream
An System.IO.Stream object that represents the file.

See Also

Reference

SPFile Class

SPFile Members

OpenBinaryStream Overload

Microsoft.SharePoint Namespace