Windows 10: Can't save to text file with visual c# universal app

Discus and support Can't save to text file with visual c# universal app in Windows 10 Software and Apps to solve the problem; 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,... Discussion in 'Windows 10 Software and Apps' started by Ken76, Nov 23, 2016.

  1. Ken76 Win User

    Can't save to text file with visual c# universal app


    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.InstalledLocation;
    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?

    :)
     
    Ken76, Nov 23, 2016
    #1

  2. Visual Studio 2015 Community

    I recently downloaded visual studio 2015 community and am trying to make a basic hello world app using c++ and xaml. So I went to the Microsoft website where it one showing how to create a basic hello world app. When they went to new project, visual C++,
    windows, and then windows universal. You guys shows Blank App(Windows Universal) while my shows Blank App(Universal Windows 8.1). And I know that I downloaded all the features needed such as the SDK, windows platform, etc. And I also know that windows 8 is
    compatible for Visual Studio, but using windows 8, I will have to create 3 different projects instead of making just one because of the universal windows platform.
     
    JoshuaMcDonald, Nov 23, 2016
    #2
  3. Can't create a new project in Visual Studio 2015

    I can't create a new project in Visual Studio Community 2015. I was trying to create a Universal Windows Blank App in Visual C#. I get an error message something saying can't create template. I am attaching the picture of the error message. Please help
    me.
    Can't save to text file with visual c# universal app [​IMG]
     
    ShubhamKumar_309, Nov 23, 2016
    #3
Thema:

Can't save to text file with visual c# universal app

Loading...
  1. Can't save to text file with visual c# universal app - Similar Threads - Can't save text

  2. Not able to save text files with Windows notepad app.

    in Windows 10 Gaming
    Not able to save text files with Windows notepad app.: Other applications do not have this problem. https://answers.microsoft.com/en-us/windows/forum/all/not-able-to-save-text-files-with-windows-notepad/9f737b64-989c-484d-bcb7-fb34bf9602e9
  3. Not able to save text files with Windows notepad app.

    in Windows 10 Software and Apps
    Not able to save text files with Windows notepad app.: Other applications do not have this problem. https://answers.microsoft.com/en-us/windows/forum/all/not-able-to-save-text-files-with-windows-notepad/9f737b64-989c-484d-bcb7-fb34bf9602e9
  4. Microsoft Visual C+ Files

    in Windows 10 Gaming
    Microsoft Visual C+ Files: Do I need to keep all of these files? https://answers.microsoft.com/en-us/windows/forum/all/microsoft-visual-c-files/c38e4fb9-1b6d-4d93-9bf2-1d82c6c9d460
  5. Microsoft Visual C+ Files

    in Windows 10 Software and Apps
    Microsoft Visual C+ Files: Do I need to keep all of these files? https://answers.microsoft.com/en-us/windows/forum/all/microsoft-visual-c-files/c38e4fb9-1b6d-4d93-9bf2-1d82c6c9d460
  6. microsoft visual c++ files

    in Windows 10 Ask Insider
    microsoft visual c++ files: i need some help here when im deleting microsoft visual studio (program) i accidently delete the microsoft visual c++ files and then i realize i delete that something might be important after that i searched that like 1 hour and finally i follow the steps in tihs website and...
  7. SAVE TEXT FILE

    in Windows 10 Software and Apps
    SAVE TEXT FILE: HOW DO I SAVE A NEW TEXT FILE https://answers.microsoft.com/en-us/windows/forum/apps_windows_10-winapps-appscat_productivity/save-text-file/01f023b9-60d7-41a5-8f09-5291aae54c07
  8. Can't save to c: root

    in Windows 10 Support
    Can't save to c: root: Get error message when I try to save a document or picture on c:\ 'A required privilege is not held by client.' Is there a way to fix this? Thank you. 14643
  9. Can't save file in C:\ root directory

    in Windows 10 Support
    Can't save file in C:\ root directory: I want to save files in my C:\ root directory of my boot drive and get an error that "Required privilege is not held by the client". I am the sole user/administrator of this system. I went into C:, properties, security, and enabled permissions for everything and everyone....
  10. What’s New in Visual Studio Tools for Universal Windows Apps

    in Windows 10 News
    What’s New in Visual Studio Tools for Universal Windows Apps: Today at //BUILD we are making an update available to the Visual Studio Tools for Universal Windows apps. Windows 10 is an exciting release for developers, with support for Universal Windows apps that run across all Windows 10 devices – on the phone in your pocket, the tablet...