标签: iis-modules

如何在IIS下设置Python WSGI服务器?

我在Windows环境中工作,并希望将代码部署到IIS.同时我想用Python编写代码.

读过IIS可以运行fastCGI应用程序之后,我去了IIS网站,详细描述了如何启动和运行PHP,但没有其他任何内容.

有没有人有经验使用其他普通的旧CGI 在IIS下运行Python框架?

如果是这样,你可以解释一下如何指导我做一些设置吗?

python deployment iis windows-server iis-modules

26
推荐指数
2
解决办法
1万
查看次数

IIS 模块和 C#:如何在将页面内容发送到客户端之前对其进行修改

我是 IIS 模块和 C# 领域的新手。

在网站将页面内容发送给客户端之前,我需要修改网站特定目录中静态 HTML 文件的内容。修改包括添加横幅、页脚等。

根据我的研究,我应该能够通过 IIS 模块实现我的目标(对吗?)。这是我的代码:

namespace MyProject
{
    public class MyModule : IHttpModule
    {
        #region IHttpModule Members

        public void Dispose()
        {

        }

        public void Init(HttpApplication context)
        {
            context.PreSendRequestContent +=
                new EventHandler(onPreSendRequestContent);
        }

        #endregion

        public void onPreSendRequestContent(Object source, EventArgs e)
        {
            HttpApplication app = (HttpApplication)source;
            HttpRequest request = app.Context.Request;
            HttpResponse response = app.Context.Response;

            if (request.Path.Contains("my_specific_directory"))
            {
                //add banner and footer to the page content
                //which class, methods, or properties to use?
            }
        }
    }
} …
Run Code Online (Sandbox Code Playgroud)

iis module decorator iis-modules

2
推荐指数
1
解决办法
1605
查看次数