Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.IO;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- namespace input_output
- {
- class Program
- {
- static void Main(string[] args)
- {
- List<string> studenti = new List<string>(new string[] { "Pavel", "Anna", "Petr", "PičoKurvaKdokoliv!!!!!" });
- StreamWriter streamWriter = null;
- try
- {
- streamWriter = new StreamWriter("studenti.txt");
- foreach(string student in studenti)
- {
- streamWriter.WriteLine(student);
- }
- }
- catch (Exception E)
- {
- Console.WriteLine("KURVO");
- }
- finally
- {
- if (streamWriter != null)
- {
- streamWriter.Close();
- }
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement