dongzhugao9929 2010-02-16 04:52 采纳率: 0%
浏览 166
已采纳

如何使用WMI和C#以编程方式在IIS6和IIS 7中添加新的应用程序映射?

My goal is to add php Extension to IIS6 and IIS 7 via Code in C# using WMi (System.Management). I cant use DirectoryEntry.

I am stuck with adding a new ScriptMap Object to IIS 6/IIS7.

I have read some posts at here and there and heard that adding new WMi object from Scratch is difficult.

I want to enable IIS 6/IIS7 to handle php as well as aspx files and be able to process them. I have extracted php zip archive to a directory on my system (not installed it). The propblem is i am able to modify existing ScriptMap objects but i dont get to understand the add a new ScriptMap Objects.

Also i am not sure whether adding the a new extensiuon handler to ScriptMap will solve the problem or not.

Please guide.

Thanks

  • 写回答

2条回答 默认 最新

  • doubao12345 2010-02-18 04:05
    关注

    @Kev. Yes. Got it. Problem solved through Thanks Kev . :-)

    The solution was

    1. to add "*.php" extension in "Extensions" Property of ScriptMap Array and "ScriptProcessor" Property to be set to the path of the "php5isapi.dll".

    2. The second thing was to add the "Default.php" (or any other suitable default php document) to zeroth index of "DefaultDoc" Array among others like "Default.aspx, Default.htm, Default.html, Default.asp" etc.

    3. The third thing was to enable/Allow the PHP ISAPI Extension. IIsWebService.EnableExtension did the trick.

    Thanks again kev for providing me the starting point.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(1条)

报告相同问题?

悬赏问题

  • ¥25 由IPR导致的DRIVER_POWER_STATE_FAILURE蓝屏
  • ¥50 有数据,怎么建立模型求影响全要素生产率的因素
  • ¥50 有数据,怎么用matlab求全要素生产率
  • ¥15 TI的insta-spin例程
  • ¥15 完成下列问题完成下列问题
  • ¥15 C#算法问题, 不知道怎么处理这个数据的转换
  • ¥15 YoloV5 第三方库的版本对照问题
  • ¥15 请完成下列相关问题!
  • ¥15 drone 推送镜像时候 purge: true 推送完毕后没有删除对应的镜像,手动拷贝到服务器执行结果正确在样才能让指令自动执行成功删除对应镜像,如何解决?
  • ¥15 求daily translation(DT)偏差订正方法的代码