static void ReadFile(string filePath) { List<string> textInMemory = new List<string>(); string path = filePath; if (string.IsNullOrEmpty(path)) path = winDir + "\\system.ini"; StreamReader reader = new StreamReader(path); try { do { textInMemory.Add(IFileReaderService.ReadLine(); } while (reader.Peek() != -1); } catch { textInMemory.Add("File is empty"); } finally { reader.Close(); } Display(textInMemory); }