Reputation: 579
I'm trying to write a text file to the roaming folder in my Windows 8.1 app. However, all the tutorials I've been able to find were written for Windows 8 and use the Windows.Storage.FileIO.WriteFileAsync method which is no longer available in Windows 8.1 apparently. What is the equivalent method for this in 8.1?
Here's the code I have so far, I just don't know what do afterwards to write the file because of the apparent change in APIs:
var applicationData = ApplicationData.Current;
var roamingFolder = applicationData.RoamingFolder;
await roamingFolder.CreateFileAsync("file.txt", CreationCollisionOption.GenerateUniqueName);
Upvotes: 0
Views: 675
Reputation: 579
I figured out the issue. When I used that method in Windows 8, I would type in the full Windows.Storage.FileIO line, but now in Windows 8.1, I only need to type in File.IO.WriteTextAsync() and it'll work. The Windows.Storage part is no longer needed in Windows 8.1 it seems.
Upvotes: 0
Reputation: 456322
I've never heard of Windows.Storage.File.IO.WriteFileAsync
. You're probably looking for Windows.Storage.FileIO
which has WriteBytesAsync
, WriteTextAsync
, etc.
Upvotes: 1