FileRandomAccessStream.OpenTransactedWriteForUserAsync 方法
定义
重要
一些信息与预发行产品相关,相应产品在发行之前可能会进行重大修改。 对于此处提供的信息,Microsoft 不作任何明示或暗示的担保。
重载
OpenTransactedWriteForUserAsync(User, String) |
在给定文件路径和用户信息的情况下,为用户打开现有文件的可写流。 |
OpenTransactedWriteForUserAsync(User, String, StorageOpenOptions, FileOpenDisposition) |
在给定文件路径和用户信息的情况下,为用户打开文件可写流。 如果该文件不存在,可以使用 FileOpenDisposition 创建它。 |
OpenTransactedWriteForUserAsync(User, String)
在给定文件路径和用户信息的情况下,为用户打开现有文件的可写流。
public:
static IAsyncOperation<StorageStreamTransaction ^> ^ OpenTransactedWriteForUserAsync(User ^ user, Platform::String ^ filePath);
/// [Windows.Foundation.Metadata.Overload("OpenTransactedWriteForUserAsync")]
/// [Windows.Foundation.Metadata.RemoteAsync]
static IAsyncOperation<StorageStreamTransaction> OpenTransactedWriteForUserAsync(User const& user, winrt::hstring const& filePath);
[Windows.Foundation.Metadata.Overload("OpenTransactedWriteForUserAsync")]
[Windows.Foundation.Metadata.RemoteAsync]
public static IAsyncOperation<StorageStreamTransaction> OpenTransactedWriteForUserAsync(User user, string filePath);
function openTransactedWriteForUserAsync(user, filePath)
Public Shared Function OpenTransactedWriteForUserAsync (user As User, filePath As String) As IAsyncOperation(Of StorageStreamTransaction)
参数
- user
- User
用于打开流的用户帐户。
- filePath
-
String
Platform::String
winrt::hstring
要打开的文件的路径。
返回
此方法完成后,它将返回 StorageStreamTransaction ,其中包含随机访问流和可用于完成事务的方法。
- 属性
Windows 要求
设备系列 |
Windows 10 Fall Creators Update (在 10.0.16299.0 中引入)
|
API contract |
Windows.Foundation.UniversalApiContract (在 v5.0 中引入)
|
适用于
OpenTransactedWriteForUserAsync(User, String, StorageOpenOptions, FileOpenDisposition)
在给定文件路径和用户信息的情况下,为用户打开文件可写流。 如果该文件不存在,可以使用 FileOpenDisposition 创建它。
public:
static IAsyncOperation<StorageStreamTransaction ^> ^ OpenTransactedWriteForUserAsync(User ^ user, Platform::String ^ filePath, StorageOpenOptions openOptions, FileOpenDisposition openDisposition);
/// [Windows.Foundation.Metadata.Overload("OpenTransactedWriteForUserWithOptionsAsync")]
/// [Windows.Foundation.Metadata.RemoteAsync]
static IAsyncOperation<StorageStreamTransaction> OpenTransactedWriteForUserAsync(User const& user, winrt::hstring const& filePath, StorageOpenOptions const& openOptions, FileOpenDisposition const& openDisposition);
[Windows.Foundation.Metadata.Overload("OpenTransactedWriteForUserWithOptionsAsync")]
[Windows.Foundation.Metadata.RemoteAsync]
public static IAsyncOperation<StorageStreamTransaction> OpenTransactedWriteForUserAsync(User user, string filePath, StorageOpenOptions openOptions, FileOpenDisposition openDisposition);
function openTransactedWriteForUserAsync(user, filePath, openOptions, openDisposition)
Public Shared Function OpenTransactedWriteForUserAsync (user As User, filePath As String, openOptions As StorageOpenOptions, openDisposition As FileOpenDisposition) As IAsyncOperation(Of StorageStreamTransaction)
参数
- user
- User
用于打开流的用户帐户。
- filePath
-
String
Platform::String
winrt::hstring
要打开的文件的路径。
- openOptions
- StorageOpenOptions
枚举值的按位组合,指定用于打开流的选项。
- openDisposition
- FileOpenDisposition
要对文件执行的操作。
返回
此方法完成后,它将返回 StorageStreamTransaction ,其中包含随机访问流和可用于完成事务的方法。
- 属性
Windows 要求
设备系列 |
Windows 10 Fall Creators Update (在 10.0.16299.0 中引入)
|
API contract |
Windows.Foundation.UniversalApiContract (在 v5.0 中引入)
|