title: how to get the application pool name for a specific website IIS6 programmatically? C#
body: <p>how to get the application pool name for a specific website IIS 6 programmatic using C#</p>
  
  <p>EDIT: 
  I already used the methods of DirectoryServices namespace but the application pool name isn't retrieved correctly unless it was explicitly set by using the same code. Which means if u add a website manually using the iis manager and set an application pool, those codes won't work (it will always return DefaultAppPool) more over when I create an application using sharepoint and set a different appPool those methods dont work.</p>