For periodic determination of Ip using code. He put on a timer (interval 3 minutes). The problem is that the Window (MsgBox) crashes only 2-4 times, and then the program freezes, without error messages. Thank you in advance :
Try Dim myHttpWebRequest As HttpWebRequest = HttpWebRequest.Create("http://ip-jobs.staff-base.spb.ru/ip.cgi") Dim myHttpWebResponse As HttpWebResponse = myHttpWebRequest.GetResponse() Dim myStreamReader As New StreamReader(myHttpWebResponse.GetResponseStream, Encoding.GetEncoding(1251)) IP = myStreamReader.ReadLine.Remove(0, 8) IP = IP.Remove(IP.Length - 2, 2) MsgBox(IP) Catch e As WebException MsgBox("!!!-!!!") End Try`