I have a little bit different problem Iam able to get the main form but when I try to go online I get a message Socket exceptioin was unhandled (The attempted operation is not supported for the type of object referenced) message. below is the code where Iam getting error. Please suggest where Am I going wrong.
Private Sub SetBcastAddress(ByVal Iface As Integer, ByVal Addr 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 ipProp = netIF(Iface).GetIPProperties() myIPCol = ipProp.UnicastAddresses() Dim lIP As UInt32 Dim lMask As UInt32 Dim lBcast As UInt32 For Each myIP In myIPCol Dim netmask As System.Net.IPAddress netmask = myIP.IPv4Mask If netmask Is Nothing Then bcastAddr = System.Net.IPAddress.Parse("172.18.1.162") Exit Sub End If lIP = Addr.Address lMask = netmask.Address lBcast = lIP Or (Not lMask) bcastAddr = New System.Net.IPAddress(lBcast) Exit Sub Next myIP End Sub
Last edited by a moderator: