禁止添加web引用

 public class AsmxHelpModule : System.Web.IHttpModule
    {
       
        private AsmxHelpModule()
        {
        }
       
        private void Application_BeginRequest(object sender, System.EventArgs e)
        {
            string requestPath = HttpContext.Current.Request.RawUrl;
            requestPath = requestPath.Trim();
            requestPath = requestPath.ToLower();
            if (((requestPath.IndexOf("?wsdl") > 0)
                        || (requestPath.IndexOf("?disco") > 0)))
            {
                throw new HttpException(404, "");
            }
        }
       
        public virtual void Init(HttpApplication app)
        {
            app.BeginRequest += new System.EventHandler(this.Application_BeginRequest);
        }
       
        public virtual void Dispose()
        {
        }
    }
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章