I think this is the right forum where Iam posting. Iam sorry if this is a wrong one.
I have a lan messenger designed in vb.net 2008 and its up and running fine in my subnet and user's are able to chat and transfer files. now my problem is that we have 2 subnets in our office and Iam not sure how to get the IP addresses of the other subnet and be able to chat with those users as well. Any help would be very much helpful to me. Below is the code which Iam using to get the IP of the local system
Thanks in advance.
I have a lan messenger designed in vb.net 2008 and its up and running fine in my subnet and user's are able to chat and transfer files. now my problem is that we have 2 subnets in our office and Iam not sure how to get the IP addresses of the other subnet and be able to chat with those users as well. Any help would be very much helpful to me. Below is the code which Iam using to get the IP of the local system
Private Function GetLocalIP() As System.Net.IPAddress Dim netIF As System.Net.NetworkInformation.NetworkInterface() = System.Net.NetworkInformation.NetworkInterface.GetAllNetworkInterfaces() Dim myIP As System.Net.NetworkInformation.UnicastIPAddressInformation Dim ipProp As System.Net.NetworkInformation.IPInterfaceProperties Dim myIPCol As System.Net.NetworkInformation.UnicastIPAddressInformationCollection Dim i As Integer If Options.localIF = -1 Then For i = 0 To UBound(netIF) If netIF(i).OperationalStatus = Net.NetworkInformation.OperationalStatus.Up Then ipProp = netIF(i).GetIPProperties() myIPCol = ipProp.UnicastAddresses() For Each myIP In myIPCol If myIP.Address.AddressFamily <> Net.Sockets.AddressFamily.InterNetworkV6 Then If System.Net.IPAddress.IsLoopback(myIP.Address) = False Then SetBcastAddress(i, myIP.Address) Return myIP.Address End If End If Next myIP End If Next i Return Nothing Else If netIF(Options.localIF).OperationalStatus = Net.NetworkInformation.OperationalStatus.Up Then ipProp = netIF(Options.localIF).GetIPProperties() myIPCol = ipProp.UnicastAddresses() For Each myIP In myIPCol SetBcastAddress(Options.localIF, myIP.Address) Return myIP.Address Next myIP End If Return Nothing End If End Function
Thanks in advance.
Last edited by a moderator: