title: Silverlight How to read a directory locally
body: <p>I am new to Silverlight and I am trying to do a directory listing of the contents of a directory. However when the first list of this code runs, it throws an exception:</p>
  
  <p>The application itself runs inside of a Browser.</p>
  
  <blockquote>
    <p>File operation not permitted. Access
    to path 'C:\Program Files\AppName' is
    denied.</p>
  </blockquote>
  
  <p>I checked permissions and they are readable so I'm not sure why it's not working.</p>
  
  <pre><code>    DirectoryInfo di = new DirectoryInfo(@"C:\Program Files\AppName");
  
      try
      {
          if (di.Exists)
          {
              Console.WriteLine("That path exists already.");
          }
      }
      catch (Exception e)
      {
          Console.WriteLine("The process failed: {0}", e.ToString());
      }
      finally { }
  </code></pre>