File access sample

This sample shows how to create, read, write, copy and delete a file, how to retrieve file properties, and how to track a file or folder so that your app can access it again. This sample uses Windows.Storage and Windows.Storage.AccessCache API.

4.2 Star
232,130 times
Add to favorites
E-mail Twitter Digg Facebook
Sign in to ask a question

  • Using a scroll with the file?
    1 Posts | Last post May 06, 2016
    • function reset(){
      	var loc = document.getElementById("textBox1").scrollLeft;
      	document.getElementById("textBox1").scrollLeft -= loc;
      function stop(){
      function start() {
      	document.getElementById("textBox1").scrollLeft += 15;
      	scrolldelay = setTimeout(function() {start();}, 300);	
  • Unable to access saved file using Stream.
    1 Posts | Last post June 06, 2015
    • I used Pickers to create file (on Desktop) & saved text in it using Streams. I saved the file in StorageApplicationPermissions.MostRecentlyUsedList.
      While reading file, I retrieved it from MostRecentlyUsedList. I'm trying to read the file using Streams. 
      But I'm getting error: "Access is denied" when I try to open file using StorageFile.OpenAsync().
      What is the reason for the error & what is the possible solution?
  • How do I access a file from onedrive using the xplatform cloud kit?
    2 Posts | Last post March 16, 2015
    • I have been working on this app that will allow access to view a file I have placed in onedrive.  How can I access this file?
    • And where would I place the code in the app.
  • Project Structure
    1 Posts | Last post December 28, 2014
    • I have downloaded C++ Sample and when I open the solution file in Visual Studio 2013 I see Windows Phone project files also uploaded. I dont want this to happen because I dont have SLAT to emulate Windows Phone on my Windows 8.1 O/S.
      What should be done so that the solution file asks the user what he/she wants to upload according to his/her choice
  • Read file from Documents to string
    1 Posts | Last post June 23, 2014
    • How read .txt file from Documents Library into string in Page Consructor.
  • Hello How can access the file from written path .
    1 Posts | Last post May 07, 2014
    • StorageFile file = await StorageFile.GetFileFromPathAsync(@"C:\MyApp\mytext.xml");
      I want to access the file like this.
  • Good sample code
    5 Posts | Last post April 22, 2014
  • File not found
    2 Posts | Last post April 20, 2014
    • I´m a begginer and maybe this is a silly question.
      I want to read a .txt from Local folder and I´m using this code:
      public async void ReadTimestamp()
            StorageFile sampleFile = await localFolder.GetFileAsync("dataFile.txt");
            String timestamp = await FileIO.ReadTextAsync(sampleFile);
            tb_salida.Text = timestamp;
         catch (Exception)
            tb_error.Text = "Not found";
      I always read "Not found", I don´t know what folder I have to use to put my file into it. So the thing is: I don´t know which is the Local Folder. I tried to put my file in many places (Assets, bin, Common...) and the other two upper folders.
       Sorry about my English and thanks.
    • one solution is to place your file in the same location as that of the .exe. make use of the Environment class to get access to this folder
      hope this helps!
  • Exception of "KnownFolders.DocumentsLibrary"
    3 Posts | Last post October 23, 2013
    • 1. I can't open the solution using Visual studio Express 2012 for Windows phone in windows phone 8 RTW(SDK 8.0)
      2. When i try to use the "StorageFolder storageFolder = KnownFolders.DocumentsLibrary;"
      in my project, it raises the "NotImplementException". (SDK 8.0)
      Can anybody help to answer my question?
    • 1) This is a Windows 8.1 application. Of course you can't open it in Windows Phone 8.
    • This not run in Windows Phone, for it is needed some adjustments
  • Javascript doesn#t work on Win7 with IE9
    2 Posts | Last post August 16, 2013
    • Hi,
      I tried to use the javascript but it doesn't work.
      I use IE9 on Win7.
    • This is a Windows 8 application and the javascript with HTML is just another way to develop Windows 8 applications.
1 - 10 of 18 Items