在IIS中配置模拟 [英] Configure impersonation in IIS

查看:68
本文介绍了在IIS中配置模拟的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,
我想创建两个虚拟目录(让它们分别称为VD1和VD2),并初始化到相同的物理目录.
两个虚拟目录之间的唯一区别应该在于模拟".
即VD1具有模拟="true",而VD2具有模拟="false"
是否可以在IIS中进行配置?
我尝试了模拟"选项,但它也更改了web.config,并且我想为两个虚拟目录保留相同的web.config.
感谢任何帮助.

Hi All,
I want to create two virtual directories (lets call them as VD1 and VD2) poiniting to the same physical directory.
The only difference between the two virtual directories should be in terms of ''Impersonation''.
i.e. VD1 has impersonation = ''true'' and VD2 has impersonation = ''false''
Is it possible to do configure this in IIS?
I tried the Impersonate option, but it also changes the web.config and I want to keep the same web.config for both the virtual directories.
Any help is appreciated.

推荐答案

冒充是Asp.net.的主题,因此,我认为您不能在IIS中进行.

您需要的是以下内容:

1.实现一种方法,该方法可以以编程方式进行模拟,并且不会在web.config中模拟.

2.使用Request.ApplicationPath属性检查虚拟目录名称,如果只有它与目标虚拟目录匹配,则调用此方法(您可以在Global.asax中的Application_BeginRequest事件或某些基类方法中执行此操作) ).

我相信,您可以使用Google并获取一些代码来进行程序设计. 此链接 [
Impersonation is a subject of Asp.net. So, I don''t think you can do this in IIS.

What you need is the following:

1. Implement a method that does impersonation programmatically, and do not impersonate in web.config.

2. Check the virtual directory name using the Request.ApplicationPath property and call this method if only it matches with your target virtual directory (You might be able to do this in the Application_BeginRequest event in Global.asax or in some base class method).

I believe, you can Google and get some codes to do programmatic impersoation. This Link[^] might help you.


这篇关于在IIS中配置模拟的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆