title: Windows 8 app: accessing local and network files
body: <p>I started programming Windows 8 apps in C#, and I need help to figure how to access files from within my app.</p>
  
  <p>Premise: from what I learned till this moment, I know that as standard an app can access only certain folders (such as LocalFolder etc.). One way to overcome this is using a FileOpenPicker once and then use FutureAccessList to access programmatically the file.</p>
  
  <p>Now my situation:</p>
  
  <ul>
  <li>my pc is connected to a domain network</li>
  <li>my app has the following capabilities: Enterprise Authentication, Internet (Client &amp; Server), Private Networks (Client &amp; Server)</li>
  <li>Let's say that I have a file named <strong>im.jpg</strong> in <strong>C:</strong> and <strong>im2.jpg</strong> in a network share called <strong>share</strong>. I (my domain account) have the access to those files.</li>
  </ul>
  
  <p>How can I access those files from my app without the use of FileOpenPicker? 
  Till now, I used WebRequest and WebResponse to download a file from an internet site (no problems), then I used WebRequest and WebResponse to access a file located in the LocalFolder of my app (still no problems), but now, if I do something like this:</p>
  
  <pre><code>WebRequest c = WebRequest.Create(@"file://C:\im.jpg");
  WebResponse r = await c.GetResponseAsync();
  </code></pre>
  
  <p>I get a System.Net.WebException telling that I'm not authorized to access the file.
  How can I use Enterprise Authentication to provide my domain credentials to the app? I didn't find much documentation about this on the MSDN, but from the little I found I think this capability is intended to be used in a situation like this. Also, is WebRequest the right path to follow? Should I try to access those files in other ways?</p>
  
  <p>Thanks, Daniele    </p>