Read and write files
You must have requested the correct permissions in the app manifest when accessing certain libraries. Local does not require any special permissions
Calls to storage functions should be wrapped in try / catch blocks as they can throw exceptions
C#using CI.WSANative.FileStorage;
C#WSANativeStorageLibrary.GetFile(WSAStorageLibrary.Pictures, "MyPicture.png", (r) =>
{
});
C#WSANativeStorageLibrary.GetFiles(WSAStorageLibrary.Pictures, "", (r) =>
{
});
C#WSANativeStorageLibrary.GetFolders(WSAStorageLibrary.Pictures, "", (t) =>
{
});
C#WSANativeStorageLibrary.DoesFileExist(WSAStorageLibrary.Pictures, "MyPicture.png");
C#WSANativeStorageLibrary.DoesFolderExist(WSAStorageLibrary.Pictures, "MyFolder");
Creates a new file and returns a handle to it, parent folders will be created automatically if necessary. If the file already exists it will be overwritten
C#WSANativeStorageLibrary.CreateFile(WSAStorageLibrary.Pictures, "MyPicture.png");
Creates a new folder, parent folders will be created automatically if necessary. If the folder already exists it will be overwritten
C#WSANativeStorageLibrary.CreateFolder(WSAStorageLibrary.Pictures, "MyFolder");
C#WSANativeStorageLibrary.DeleteFile(WSAStorageLibrary.Pictures, "MyPicture.png");
C#WSANativeStorageLibrary.DeleteFolder(WSAStorageLibrary.Pictures, "MyFolder");