1. Ken Ekholm's Avatar
    I can't save any changes to the text file settings.txt , but reading the file works.
    The code is
    private async void LedShow_Loaded(object sender, RoutedEventArgs e)
    {
    var path = @"settings.txt";
    var folder = Windows.ApplicationModel.Package.Current.Installed Location;
    var file = await folder.GetFileAsync(path);
    var lines = await Windows.Storage.FileIO.ReadLinesAsync(file);
    sliderDelay.Value = Convert.ToInt32(lines[0]);
    textBlockDelayValue.Text = lines[0] + " seconds";
    buttonSave.IsEnabled = false;
    }
    and the error message is

    An exception of type 'System.UnauthorizedAccessException' occurred in System.Private.CoreLib.dll but was not handled in user code
    Access is denied. (Excep_FromHResult 0x80070005) occurred
    Can someone help me?
    11-24-2016 01:51 PM

Similar Threads

  1. Don't miss this rare $50 savings on the Sonos Play:1 speaker!
    By WindowsCentral.com in forum Windows Central News Discussion
    Replies: 0
    Last Post: 11-24-2016, 01:42 PM
  2. How to be an ace pilot in Battlefield 1
    By WindowsCentral.com in forum Windows Central News Discussion
    Replies: 0
    Last Post: 11-24-2016, 12:11 PM
  3. Can I get Edge favorites to another Browser?
    By Windows Central Question in forum Ask a Question
    Replies: 1
    Last Post: 11-24-2016, 11:49 AM
  4. Resident Evil 7 will hit the Windows 10 Store in addition to Xbox One
    By WindowsCentral.com in forum Windows Central News Discussion
    Replies: 0
    Last Post: 11-24-2016, 11:11 AM
  5. Get VR ready with this awesome PC and Oculus Rift deal!
    By WindowsCentral.com in forum Windows Central News Discussion
    Replies: 0
    Last Post: 11-24-2016, 10:30 AM
LINK TO POST COPIED TO CLIPBOARD