StreamReader in Windows 10 Universal App

后端 未结 1 1614
你的背包
你的背包 2021-01-26 06:28

I am trying to read from a XML file in Windows 10 Universal App. StreamReader only takes Stream as argument. I used to do this with the file path in WinForms, WPF or MVC but I d

相关标签:
1条回答
  • Indeed, Windows 10 and the sandbox has many limitations in where you can read from/write to.

    This is not a Windows 10 App "Problem", but a Windows Store App Api change. A common way to read a file in a Windows Store App is to use the StorageFile:

     StorageFile file = 
          await StorageFile.GetFileFromApplicationUriAsync("ms-appx:///yourFile.txt");
    

    Take a look at this post, to get more information about reading files in windows 10.

    0 讨论(0)
提交回复
热议问题