title: ASP.Net Web service. How to reject request?
body: <p>I have asmx web service and I would like to reject all requests coming from all ip addresses except one I know.</p>
  
  <p>I used Application_BeginRequest but after I confirm that the ip is not the ip I know, I would like to know what I need to replace the comment in the code bellow.</p>
  
  <p>Thanks</p>
  
  <pre><code>protected void Application_BeginRequest(object sender, EventArgs e)
  {
       var  address = "916.222.18.0";
       var ip = Context.Request.ServerVariables["REMOTE_ADDR"];
  
       if (ip != address)
       {
           // reject request
       }
  }
  </code></pre>