搜索
aardio官方社区 门户 查看主题

IIS7 调用 Microsoft.Web.Administration 自动注册FastCGI

发布者: Jacen.He | 发布时间: 2017-4-15 14:28| 查看数: 600| 评论数: 0|帖子模式

import dotNet;
var appDomain = dotNet.clr().createAppDomain();

var serverManager = appDomain.load("Microsoft.Web.Administration").createInstance("ServerManager");
var config = serverManager.GetWebConfiguration("update.aardio.com");
var handlersSection = config.GetSection("system.webServer/handlers");

var handlersCollection = handlersSection.GetCollection();
var addElement = handlersCollection.CreateElement("add");
addElement.Item[
"name"] = "aardio";
addElement.Item[
"path"] = "*.aardio";
addElement.Item[
"verb"] = "*";
addElement.Item[
"modules"] = "FastCgiModule";
addElement.Item[
"scriptProcessor"] = "D:\AardioCGI\Publish\AardioCGI.exe";
handlersCollection.AddAt(0, addElement);
serverManager.CommitChanges();

最新评论

手机版|未经许可严禁引用或转载本站文章|站长邮箱|aardio.com|aardio官方社区 ( 皖ICP备09012014号 )

GMT+8, 2017-11-21 16:09 , Processed in 0.078125 second(s), 18 queries , WinCache On.

Powered by Discuz! X3.4

© 2001-2017 Comsenz Inc.

快速回复 返回顶部 返回列表