Advertisement
Guest User

Untitled

a guest
Jan 16th, 2018
65
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.81 KB | None | 0 0
  1. private void button4_Click(object sender, EventArgs e)
  2. {
  3.  
  4. FileInfo plik = new FileInfo("wyjscie.txt");
  5.  
  6. StreamReader str_we = plik.OpenText();
  7. str_we.ReadLine();
  8. StreamWriter str_wy = new StreamWriter("C:/Users/Damian/Desktop/WindowsFormsApplication1/WindowsFormsApplication1/wyjscie.txt", !checkBox1.Checked);
  9.  
  10.  
  11.  
  12. for (int i = 0; i < kolekcja.Count; i++)
  13. {
  14. if (kolekcja[i] is Drzewo2)
  15. {
  16. str_wy.WriteLine(kolekcja[i].Nazwa + "," + kolekcja[i].Rodzaj + "," + ((Drzewo2)kolekcja[i]).Wysokosc);
  17. }
  18. else str_wy.WriteLine(kolekcja[i].Nazwa + "," + kolekcja[i].Rodzaj);
  19.  
  20. }
  21. str_we.Close();
  22. str_wy.Close();
  23.  
  24. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement