Search code examples
windows-phone-8

How to create a new folder in Pictures Folder in phone memory on windows phone 8?


I'm new in developing windows phone 8 applications and i want to know how can I create a new folder in pictures folder in phone memory. An example would be great! In these pictures is showing the location where i want to create the new folder What capabilities should I declare for this purpose? Here is my code but it doesn't work.

StorageFolder folder = KnownFolders.PicturesLibrary;
StorageFolder myFolder = await folder.CreateFolderAsync("MyNewFolder", CreationCollisionOption.ReplaceExisting);
StorageFile myFile = await myFolder.CreateFileAsync("MyInformation.txt");
using (StreamWriter f = new StreamWriter(myFile.Path))
{
    f.WriteLine("ABC");
    f.Close();
}


Solution

  • In windows phone 8 sdCard is read only. In windows phone 8.1 or higher sdCard is writable