title: Does directory.exists work for URLs?
body: <p>I want to check if a folder exists in sharepoint. But it could be any folder hosted in IIS. </p>
  
  <p>Does Directory.Exists work? If not...</p>
  
  <p>I found this method below, but it only creates the folder, no check to see if it already exists or not, does anyone have some working code to check if the folder exists?:</p>
  
  <pre><code> private bool CreateFolder(string folderURL)
  
          {
  
              try
  
              {
  
                  WebRequest request = WebRequest.Create(folderURL);
  
                  request.Credentials = m_credentials;
  
                  request.Method = "MKCOL";
  
                  WebResponse response = request.GetResponse();
  
                  response.Close();
  
                  return true;
  
              }
  
              catch (WebException)
  
              {
  
                  return false;
  
              }
  
          }
  </code></pre>