我做了个简单的网络管理程序,不过还有问题没有解决
我用人家做的东西,不需要关心IP地址的问题,只要在同一个网段装上客户端和服务器端就行了,他们彼此就可以找到对方我做的不行,如果不同的网段就要根据不同的IP地址重新编译,而且,服务器端只可以装在固定的机器上,而人家做的,随便装那台都行!请给出解决的办法

解决方案 »

  1.   

    你可以开机群发一个你自己规定的串(如"are you?")到网段上所有IP,有回应的就是服务器了(服务器轮巡判断接收到这个串就回应),
      

  2.   

    to work in subnet, the easiest way is to use subnet-broadcast, that is, do all communications using address SUBNET.FF. For example, if your subnet is 192.168.0.X, then use 192.168.0.FF.if you want it work cross several subnet, the easiest way is to let Server Address settable in Client's software.