private void UpdateFileList() { var content = JsonConvert.SerializeObject(IPList.ToList()); if (File.Exists(FILE_NAME)) { File.Delete(FILE_NAME); } using (var sw = new StreamWriter(FILE_NAME)) { sw.Write(content); } }