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.Windows.Forms;
- namespace Generator
- {
- public partial class Generator : Form
- {
- public Generator()
- {
- InitializeComponent();
- }
- private void button1_Click(object sender, EventArgs e)
- {
- timer1.Start();
- if ((progressBar1.Value == 100))
- {
- timer1.Stop();
- progressBar1.Value = 0;
- textBox1.Text = "";
- timer1.Start();
- }
- }
- private void timer1_Tick(object sender, EventArgs e)
- {
- progressBar1.Increment(1);
- if ((progressBar1.Value == 100))
- {
- timer1.Stop();
- Random random = new Random();
- textBox1.Text = "" + (char)random.Next(65, 90) + (char)random.Next(65, 90) + (char)random.Next(65, 90) + random.Next(0, 9) + "-" + random.Next(0, 9) + (char)random.Next(65, 90) + (char)random.Next(65, 90) + random.Next(0, 9) + "-" + (char)random.Next(65, 90) + random.Next(0, 9) + (char)random.Next(65, 90) + random.Next(0, 9) + "-" + (char)random.Next(65, 90) + random.Next(0, 9) + (char)random.Next(65, 90) + random.Next(0, 9) + "-" + (char)random.Next(65, 90) + random.Next(0, 9) + (char)random.Next(65, 90) + random.Next(0, 9);
- }
- }
- private void textBox1_TextChanged(object sender, EventArgs e)
- {
- textBox1.TextAlign = HorizontalAlignment.Center;
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment