|
HTTP,MySQL,Apache,PHP,Linux,Server,SEO,google,Ports,Network,Remove Pass-phase,SSL,Installation,缓存,Cache,Proftpd,FTP,Index,新闻组,Myspace,Discuz,IIS,Mambo,MySQL Remote Access,因特网,Internet,美国企业,重定向,Indy Li
| 阅读上一个主题 :: 阅读下一个主题 |
| 留言 |
|
How to Remove IIS "Server" Header?
|
|
| |
|
发布人: Mrs LA
发布于: 2008/05/06, 12:05 pm
|
|
可以通过代码实现:
| 代码: |
public class Module : IHttpModule
{
public Module()
{
}
#region IHttpModule Members
public void Dispose()
{
return;
}
public void Init(HttpApplication context)
{
context.EndRequest += new EventHandler(context_EndRequest);
}
void context_EndRequest(object sender, EventArgs e)
{
HttpApplication app = (HttpApplication)sender;
app.Response.Headers.Remove("Server");
}
#endregion
|
但是仅限于IIS7+.net 3.0+
The Headers property is only supported with the IIS 7.0 integrated pipeline mode and at least the .NET Framework 3.0. When you try to access the Headers property and either of these two conditions is not met, a PlatformNotSupportedException is thrown.
|
|
|
|
|
|
返回页首
|
|
 |
|
热门标签: HTTP(8), MySQL(7), Apache(4), PHP(4), Linux(2), Server(2), SEO(2), google(2), Ports(1), Network(1), Remove Pass-phase(1), SSL(1), Installation(1), 缓存(1), Cache(1), Proftpd(1), FTP(1), Index(1), 新闻组(1), Myspace(1), Discuz(1), IIS(1), Mambo(1), MySQL Remote Access(1), 因特网(1), Internet(1), 美国企业(1), 重定向(1), Indy Library(1), 攻击(1)
|
|