Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public partial class DialogHistorie : Form
- {
- ArrayList data = new ArrayList();
- string fileName = "historie.txt";
- public DialogHistorie()
- {
- InitializeComponent();
- nactiTxtSoubor();
- }
- private void nactiTxtSoubor()
- {
- string retezec;
- data.Clear();
- using (StreamReader sr = new StreamReader(File.OpenRead(fileName)))
- {
- while (!sr.EndOfStream)
- {
- retezec = sr.ReadLine();
- data.Add(retezec);
- }
- }
- naplnTextBox();
- }
- private void naplnTextBox()
- {
- textBox1.Text = "";
- foreach (string retezec in data)
- {
- textBox1.AppendText(retezec + "\n");
- }
- }
- private void button1_Click(object sender, EventArgs e)
- {
- Close();
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement