private void initdataload() { using (WebClient wc = new WebClient()) { string URL = Form1.jsonURL + "=360"; var json = string.Empty; bool initialtry = true; while (initialtry) { try { json = wc.DownloadString(URL.ToString()); initialtry = false; } catch (WebException e) { bool windowopen = FormIsOpen(Application.OpenForms, typeof(frmPopup)); if (!windowopen) { frmPopup frmpop = new frmPopup(); frmpop.ShowDialog(); } Console.WriteLine($"{e}"); } } datalist = JsonConvert.DeserializeObject <List <JSONModel> >(json); chart1.DataSource = datalist; chart1_settings(); processTick(); updatetimer.Interval = 5500; updatetimer.Start(); } }