0

I'm trying to play a file on the MediaElement from a network location within a domain.

I have tried using impersonation as explained here: I can't access unc path from C#. Getting access is denied

i'm getting Error: 5 'Access is denied' when trying to perform the impersonation.

Also Setting the share to 'Everyone' did not help if I wanted to just copy (or open) the file from network to local

I have tried with the StorageFolder:

 StorageFolder folder = await StorageFolder.GetFolderFromPathAsync(Path.GetDirectoryName("FILELOCATION"));
 StorageFile file = await folder.GetFileAsync(Path.GetFileName("FILENAME"));
 var stream = file.OpenAsync(Windows.Storage.FileAccessMode.Read).GetResults();

And just with File.Copy("FileLocation","LocalFileLocation")

Nothing seems to work. Is there anybody here that can help?

Thanks is advance

Community
  • 1
  • 1
Zarkos
  • 457
  • 10
  • 30
  • You can [use FileOpenPicker to access](https://msdn.microsoft.com/en-us/library/windows/apps/mt187272.aspx#set_the_media_source) files on Raspberry Pi. – Rita Han Aug 14 '17 at 02:48
  • This is not really helping me because the music files are loaded in the background. It's an unattended app where people can schedule commercials playing. – Zarkos Aug 16 '17 at 08:35
  • Have you checked [this](https://social.msdn.microsoft.com/Forums/windowsapps/en-US/e822c960-f15d-4789-9ff2-040212d0a67c/uwpaccess-a-file-on-a-network-drive?forum=wpdevelop)? – Rita Han Aug 17 '17 at 02:14

0 Answers0