title: C# Sockets - Banning IP Adresses
body: <p>I've got a question on Sockets in C#. I've got a Server which I want to prevent from connecting to clients where the IP was banned. Both are made with .NET 4.0 . </p>
  
  <p>The server is running via Internet (No-ip hostname), not just in a local network. The problem is that the IP of the clients is changing every day, so I don't know how to ban these clients permantly. I know that I can ban them by simply comparing the IP of the Client with any banned adress.</p>
  
  <pre><code>if ( banned_ip == clients_ip )
  {
       client.Disconnect();
  }
  </code></pre>
  
  <p>But how do I fetch the Client's IP I can ban permantly ?</p>
  
  <p>If you need some more infos, I'm gonna post them.</p>
  
  <p>Joe</p>