Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- List<string> TextData = new List<string>();
- try
- {
- using (StreamReader streamReader = new StreamReader(filePath))
- {
- string line = streamReader.ReadLine();
- while (streamReader.Peek() > -1)
- {
- TextData.Add(streamReader.ReadLine());
- streamReader.Close();
- return TextData;
- }
- }
- }
- catch (Exception e)
- {
- Console.WriteLine("The file could not be read:");
- Console.WriteLine(e.Message);
- return null;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement