Dim server As ServerSocket 'Only used to show the device IP.
...
Sub UpdateIp
Dim ip As String
ip = server.GetMyIP
If ip = "127.0.0.1" Then
Msgbox("Device must first be connected to a network.", "")
ip = "Not connected to network."
End If
lblIp.Text = "My IP: " & ip
End Sub