DirectoryEntry de = new DirectoryEntry("IIS://localhost/" + "w3svc");   
object[] prams = new object[2] { "IIsWebServer", Convert.ToInt32(siteName) };
DirectoryEntry site = (DirectoryEntry)de.Invoke("Create", prams); /
DirectoryEntry root = site.Children.Add("Root", "IIsWebVirtualDir"); 
root.Properties["AppPoolId "][0] = "test1"; //应用程序池
在创建应用程序池的时候不是这样的吗?