Forum Xamarin.Forms
We are excited to announce that the Xamarin Forums are moving to the new Microsoft Q&A experience. Q&A is the home for technical questions and answers at across all products at Microsoft now including Xamarin!

We encourage you to head over to Microsoft Q&A for .NET for posting new questions and get involved today.

Access denied at saving file in uwp

SherifAwadSherifAwad Member ✭✭

I tried to save a file in uwp, but the access denied.

                String fileName = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.UserProfile), "Record", "record.opml");
                String dirName = Path.GetDirectoryName(fileName);

                if (!Directory.Exists(dirName))
                    Directory.CreateDirectory(dirName);

                if (!File.Exists(fileName))
                    File.Create(fileName);

                using (var streamWriter = new StreamWriter(fileName, true))
                {
                    streamWriter.WriteLine(doc);
                }

Best Answer

Answers

  • SherifAwadSherifAwad Member ✭✭

    Thanx @LandLu

  • imaginary13imaginary13 Member

    How to put my app into "Choose which apps can access your file system" ?

Sign In or Register to comment.