共用方式為


FileRandomAccessStream.OpenTransactedWriteForUserAsync 方法

定義

多載

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 引進)

適用於