locked
Managing work folder within Windows 8 App ? RRS feed

  • Question

  • Hi all,

    Does anyone know if it's possible to manage files and folders within a work folder in a Windows 8 app ?

    Thanks.

    Friday, August 8, 2014 1:30 PM

Answers

All replies

  • You can use the Windows.Storage.StorageFolder.CreateFolderAsync and Windows.Storage.StorageFolder.CreateFileAsync to create sub-folders and files in the local folder respectively: http://msdn.microsoft.com/en-us/library/windows/apps/dn531045.aspx.

                Windows.Storage.StorageFolder localFolder = Windows.Storage.ApplicationData.Current.LocalFolder;
                await localFolder.CreateFolderAsync("subfolder");
    
                Windows.Storage.StorageFolder subFolder = await localFolder.GetFolderAsync("subfolder");
                await subFolder.CreateFileAsync("text1.txt");
    

    The StorageFolder class also has a DeleteAsync method that removes the folder and you can delete a file by first calling the  Windows.Storage.StorageFolder.GetFileAsync to get a Windows.Storage.StorageFile that represents the file and remove it using the DeleteAsync() method:

                Windows.Storage.StorageFile file = await subFolder.GetFileAsync("text1.txt");
               await file.DeleteAsync();
    

    Friday, August 8, 2014 1:51 PM
  • Thanks for the reply !

    Are you sure that it's working with this implementation ?

    Because in work folders, files can be encrypted by the organisation (more info here).

    Don't know if there is any API that encrypt/decrypt files automaticaly with the user credentials or certificate.

    Thanks !

    Friday, August 8, 2014 2:05 PM
  • Found a solution : more info here

    Using  FileRevocationManager APIs should manage security for company files !

    Thanks !



    • Edited by essamdahab Monday, August 11, 2014 9:22 AM
    • Marked as answer by essamdahab Monday, August 11, 2014 9:22 AM
    Monday, August 11, 2014 9:21 AM