简体   繁体   English

在LAN中分配IP地址

[英]Assign IP address in a LAN

I need to assign IP addresses to computers in a LAN through programming (preferably java). 我需要通过编程(最好是java)为局域网中的计算机分配IP地址。

The Client will have a form with few buttons each of which have default IP address. 客户端将有一个几乎没有按钮的表单,每个按钮都有默认的IP地址。 when a user clicks on any one of the button, the server(on windows) needs to assign a new IP address from a range of IP addresses for each button. 当用户点击任何一个按钮时,服务器(在Windows上)需要为每个按钮分配一系列IP地址的新IP地址。

This is only for a demo purpose for a college project. 这仅用于大学项目的演示目的。

I would greatly appreciate for ant posts, blog. 我非常感谢蚂蚁帖子,博客。

Thanks in advance 提前致谢

Here are two threads related to your question: 以下是与您的问题相关的两个主题:

Change Computer IP address using JAVA how to change local machine/ethernet ip address 使用JAVA更改计算机IP地址 如何更改本地计算机/以太网IP地址

However, if you want to assign IP address for other computer in a LAN, then you probably need to read about DHCP. 但是,如果要为LAN中的其他计算机分配IP地址,则可能需要阅读有关DHCP的信息。 You will need to build the communication with a particular host first without knowing their address. 您需要首先与特定主机建立通信,而不知道他们的地址。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM