'How to Read myFolder txt File in UWP

I want to Read textFile in my Userfolder in UWP but i got error like this

'Access to the path 'C:\Users\Administrator\log\config.txt' is denied.'

 string path = @"C:\Users\Administrator\log\config.txt";
 string textValue = System.IO.File.ReadAllText(path);
 Debug.WriteLine(textValue);

UWP can't read folder in a specific path???



Solution 1:[1]

UWP was designed as a sandbox to increase a user security. Thus, by default your app can see only limited list of folders, like its private subfolder or any of standard locations like My Docs, My Pictures etc. If you need something outside the default, there is a manifest permission to be specified (broadFileSystemAccess) or then let the user pick deisred file interactively to get explicit consent:

https://docs.microsoft.com/en-us/windows/uwp/packaging/app-capability-declarations

In most cases, to get access to file system locations, your app can use the FileOpenPicker, FileSavePicker, FolderPicker, and FutureAccessList APIs. If you want to request approval to use the broadFileSystemAccess capability, then you must provide specific reasons as to why those APIs aren't sufficient for your needs.

Solution 2:[2]

df.plot() fortunately returns a matplotlib.AxesSubplot so you can change paramaters as you would usually do. Also, to properly define datetime xticks, you should use the matplotlib.dates package.

import matplotlib.pyplot as plt
import matplotlib.dates as md
ax = df.plot(color=colors)
min_time = df.index.minute.min
max_time = df.index.minute.max
time_int = 5
xlocator = md.MinuteLocator(byminute=np.arange(min_time, max_time+1, time_int), interval = 1)
ax.xaxis.set_major_locator(xlocator)

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Yury Schkatula
Solution 2 Benjamin Rio