title: Sharepoint c# retrieve all site and subsite
body: <p>I'am trying to retrieve all site and subsite in sharepoint but i get access denied.</p>
  
  <p>I read about to use GetSubwebsForCurrentUser() property, but i get the same message.</p>
  
  <p>My code is the next</p>
  
  <pre><code>            foreach (SPWebApplication webApp in SPWebService.ContentService.WebApplications)
              {                    
                  foreach (SPSite siteCollection in webApp.Sites)
                  {
                      foreach(SPWeb web in siteCollection.RootWeb.GetSubwebsForCurrentUser())
                      {
                         dropDownSite.Items.Add(web.Url);
                      }
  
  
                  }
              }
  </code></pre>
  
  <p>please i need help! Thanks!</p>