namespace test
{
       public class test
       {
              private DirectoryEntry _iisServer;
              public ConfigSetup()
              {
                     
              }
              private void Connect()
              {
                     try
                     {
                            _iisServer = new DirectoryEntry("IIS://" + "localhost" + "/W3SVC/1");
                     }
                     catch (Exception e)
                     {
                            throw new Exception("Could not connect to: " + "localhost",e);
                     }
              }
              
       
public string GetWatchPath()
              {
                     string WatchPath;
                     Connect();
                     DirectoryEntry folderRoot = _iisServer.Children.Find("Root","IIsWebVirtualDir");
                     WatchPath = folderRoot.Properties["Path"].Value.ToString() + "\\CloneDB\\ExportFiles";
                     return WatchPath;
              }
              
       }
}