📜  以编程方式创建 iis 池 c# 代码示例

📅  最后修改于: 2022-03-11 14:49:11.554000             🧑  作者: Mango

代码示例1
private static void CreateAppPool(string poolname,bool enable32bitOn64, ManagedPipelineMode mode,string runtimeVersion="v4.0")  
{  
    using (ServerManager serverManager = new ServerManager())  
    {  
        ApplicationPool newPool = serverManager.ApplicationPools.Add(poolname);  
        newPool.ManagedRuntimeVersion = runtimeVersion;  
        newPool.Enable32BitAppOnWin64 = true;  
        newPool.ManagedPipelineMode = mode;  
        serverManager.CommitChanges();  
    }  
}