BinaryData.FromFileAsync Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Overloads
| FromFileAsync(String, CancellationToken) |
Creates a BinaryData instance from the specified file. |
| FromFileAsync(String, String, CancellationToken) |
Creates a BinaryData instance from the specified file and sets MediaType to <see pref="mediaType"></see> value. |
FromFileAsync(String, CancellationToken)
- Source:
- BinaryData.cs
Creates a BinaryData instance from the specified file.
public static System.Threading.Tasks.Task<BinaryData> FromFileAsync(string path, System.Threading.CancellationToken cancellationToken = default);
static member FromFileAsync : string * System.Threading.CancellationToken -> System.Threading.Tasks.Task<BinaryData>
Public Shared Function FromFileAsync (path As String, Optional cancellationToken As CancellationToken = Nothing) As Task(Of BinaryData)
Parameters
- path
- String
The path to the file.
- cancellationToken
- CancellationToken
A token that can be used to cancel the operation.
Returns
A value representing all of the data from the file.
Applies to
FromFileAsync(String, String, CancellationToken)
- Source:
- BinaryData.cs
Creates a BinaryData instance from the specified file and sets MediaType to <see pref="mediaType"></see> value.
public static System.Threading.Tasks.Task<BinaryData> FromFileAsync(string path, string? mediaType, System.Threading.CancellationToken cancellationToken = default);
static member FromFileAsync : string * string * System.Threading.CancellationToken -> System.Threading.Tasks.Task<BinaryData>
Public Shared Function FromFileAsync (path As String, mediaType As String, Optional cancellationToken As CancellationToken = Nothing) As Task(Of BinaryData)
Parameters
- path
- String
The path to the file.
- cancellationToken
- CancellationToken
A token that can be used to cancel the operation.
Returns
A value representing all of the data from the file.