I am experimenting with websockets and I want to make it connect to local network automatically from another computer on the LAN and since there are 255 possible computers on the same network I want it to try all and then connect to whichever it can connect to first. However, first part of an IP address, 192.168.1.*, is different based on router settings.
I can get the whole current IP address of the machine, then I want to extract the front part.
For example
25.0.0.5 will become 25.0.0.
192.168.0.156 will become 192.168.0.
192.168.1.5 will become 192.168.1.
and so on
String Ip = "123.345.67.1";
//what do I do here to get IP == "123.345.67."