1

有没有一种简单的方法在 C# 中使用 TCPListener 来阻止来自欧洲大陆的所有传入连接?我需要执行以下操作才能决定是否阻止连接:

  1. 确定客户的位置(如果在欧洲,则继续步骤 2,否则,绕过安全检查)
  2. 从客户端读取身份验证令牌(会话 ID)。如果会话 ID 表明客户是非欧洲国家的公民,则授权连接。否则,立即关闭 NetworkStream。
4

2 回答 2

2

You could try polling using a C# GeoIP locator and doing a DNSBL list for your application (though I assume you're already doing such by asking this question).

于 2011-02-10T00:54:39.030 回答
2

You can check on an online database to check where the connection is comming from. Zack has given an link to MaxMind's IP locator.

于 2011-02-10T00:57:02.830 回答