using (var dataWriter = new (outputStream))ĭataWriter.WriteString("DataWriter has methods to write to various types, such as DataTimeOffset.") Now add this code (if you're using C#, within the existing using statement) to write to the output stream by creating a new DataWriter object and calling the DataWriter.WriteString method. ' We'll add more code here in the next step. Using outputStream = stream.GetOutputStreamAt(0) IOutputStream^ outputStream = stream->GetOutputStreamAt(0) Windows::Storage::StorageFolder storageFolder Create a sample file replace if exists. Windows::Foundation::IAsyncAction ExampleCoroutineAsync() LocalFolder Īwait storageFolder.CreateFileAsync("sample.txt", Here's how to create a file in the app's local folder. You can learn how to get a file by using a file picker in Open files and folders with a picker. Know how to get the file that you want to read from, write to, or both To learn how to write asynchronous apps in C++/CX, see Asynchronous programming in C++/CX. To learn how to write asynchronous apps in C++/WinRT, see Concurrency and asynchronous operations with C++/WinRT. You can learn how to write asynchronous apps in C# or Visual Basic, see Call asynchronous APIs in C# or Visual Basic. Understand async programming for Universal Windows Platform (UWP) apps For a complete sample, see the File access sample.
0 Comments
Leave a Reply. |