阻止用户在 C# .NET for Windows Forms 中更改其计算机地址的访问

发布于 2024-10-02 12:08:14 字数 259 浏览 0 评论 0原文

我想要的是:

有一个适用于 Windows XP SP2 和 Windows XP SP2 的 Windows 应用程序(用 .NET 3.5、VS2008、C# 制作)。 SP3

一般用户可以更改IP或修改他们的IP地址。

现在,当我的应用程序启动时,我不希望用户更改 IP 地址,直到我的应用程序停止。

希望现在问题能清楚了。

很快需要您的建议。

仅推荐 C# .NET 或 VB.NET 中的解决方案。

What i want is :

There is one windows app ( made in .NET 3.5, VS2008, C# ) for Windows XP SP2 & SP3

generally users can change there IP or modify their IP Address.

Now,when my apps starts i dont want users to change there IP Address untill my app stops.

Hope now question would be clear.

Need your advice soon.

Recommend solution in C# .NET or VB.NET only.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

地狱即天堂 2024-10-09 12:08:14

一般用户可以更改IP或修改他们的IP地址。

不,他们不这样做,这是一项非常特权的操作。需要管理员帐户。在 Vista 和 Win7 上,必须确认 UAC 提示。阻止管理员管理机器是注定失败的,而且通常是一种敌对行为。毫无意义的是,管理员拥有杀死您的应用程序所需的所有权力。

解决真正的问题。您可以指望使用管理员帐户运行应用程序的日子已经一去不复返了。任何运行 Vista 或 Win7 的人都会很快卸载你的应用程序。

generally users can change there IP or modify their IP Address.

No they don't, it is a very privileged operation. An administrator account is necessary. On Vista and Win7 the UAC prompt has to be acknowledged. Preventing an admin from administering the machine is a lost cause and in general a hostile act. And pointless, the admin has all the required powers to kill your app.

Fix the real problem. The days that you could count on having your app run with an admin account are long gone. Anybody that runs Vista or Win7 is quickly going to uninstall your app.

逆光飞翔i 2024-10-09 12:08:14

我认为您无法采取太多措施来暂时阻止用户更改其 IP 地址。

  1. 在大多数计算机上,IP 地址由 DHCP 服务器控制。如果该服务器决定您需要更改 IP 地址,您必须遵循,否则您的连接将被关闭。
  2. 管理员可以更改 IP 地址,您可以从管理组中删除用户(但这并不妨碍第 1 点)。但这应该意味着您拥有受控的用户群(在企业中),并且应该允许您这样做。 (如果他们不是管理员,你如何将他们放回管理员组)?

如果您的应用程序的设计依赖于始终具有相同的 IP 地址,那么它可能是错误的。或者你应该在“要求”中提及。

例如:对于不间断的“操作”,P2P 客户端(如 Bittorrent)依赖于具有相同的 IP 地址,但他们并不强制这样做。

I don't think there is much you can do to temporarily prevent users from changing their IP addresses.

  1. On most machines the IP address is controlled by the DHCP server. If this server decides you need to change IP address, you have to follow or your connection is closed.
  2. Administrators can change the IP address, you could remove a user from the admin group (but that does not prevent point 1). But that should mean you have a controlled user base (in an enterprise), and you should be allowed to do that. (And how are you going to put them back into the admin group if they are not an admin)?

Maybe the design of your application is wrong, if it depends on always having the same IP address. Or you should mention it in the "requirements".

For example: for un-interrupted "action", P2P clients (like Bittorrent) depend on having the same IP address, but they do not enforcing this.

勿挽旧人 2024-10-09 12:08:14

我不认为你可以阻止访问,但你可以监视IP地址,当它发生变化时,你可以使用WMI将其回滚到旧的IP。

I don't think you can block the access, but you can monitor the IP address, and when it changes you can roll it back to the old IP using WMI.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文