title: How to restrict a website to get access to a specific path through IIS?
body: <p>I'm looking for a way to restrict a website served by IIS so that the website can get access to the specific folder or drive not more, let me illustrate it.</p>
  
  <p>Imagine I have two websites <code>A</code> and <code>B</code> served by IIS, you can put following code in code-behind of both websites:</p>
  
  <pre><code>string windowsPath = Environment.GetFolderPath(Environment.SpecialFolder.Windows)
  string path = windowsPath + @"\Microsoft.NET\Framework";
  var directories = Directory.GetDirectories(path);
  </code></pre>
  
  <p>I need a way through IIS to restrict website <code>A</code> not be able to get access to the mentioned <code>directories</code> and only website <code>B</code> be able to do that. In other words I want to restrict read access.</p>
  
  <p>I suppose it should have a simple solution because it's what hosting servers deal with. It's obvious that you can't put a piece of code in your website in a web hosting server and simply get access to list files name located in drive C of the hosting server.</p>
  
  <p>How can I achieve that?</p>