Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- using System.ComponentModel;
- using System.Data;
- using System.Drawing;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- using System.Windows.Forms;
- namespace losowanie
- {
- public partial class Form1 : Form
- {
- private Animacja AN;
- public Form1()
- {
- InitializeComponent();
- }
- private void button1_Click(object sender, EventArgs e)
- {
- openFileDialog1.ShowDialog();
- }
- private void richTextBox1_TextChanged(object sender, EventArgs e)
- {
- }
- private void openFileDialog1_FileOk(object sender, CancelEventArgs e)
- {
- string filePath = openFileDialog1.FileName;
- string[] lines = System.IO.File.ReadAllLines(filePath);
- textBox1.Text = filePath;
- foreach (string line in lines)
- {
- richTextBox1.Text += line + '\n';
- }
- button2.Enabled = true;
- }
- private void button2_Click(object sender, EventArgs e)
- {
- AN = new Animacja();
- AN.Setparent(this);
- AN.Show();
- string filePath = openFileDialog1.FileName;
- string[] lines = System.IO.File.ReadAllLines(filePath);
- Random rand1 = new Random();
- int num1 = rand1.Next(0, 5);
- textBox2.Text = lines[num1];
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement