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 WindowsFormsApplication5
- {
- public partial class Form1 : Form
- {
- public Form1()
- {
- InitializeComponent();
- }
- private void button1_Click(object sender, EventArgs e)
- {
- /* int[] numbers = new int[10] { 1, 2, 3, 4, 5, 6, 7, 8, 9, 0 };
- char[] letters = new char[26] { 'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z' };
- for(int i = 0; i < 24; i++)
- {
- }*/
- char[] letters = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789!@#$%^&*()_-".ToCharArray();
- Random r = new Random();
- string randomString = "";
- var random = new Random();
- // for (int i = 0; i < letters.Length; i++)
- for (int i = 0; i < 24; i++)
- {
- randomString += letters[r.Next(0,74)].ToString();
- }
- textBox1.Text = randomString;
- }
- private void Form1_Load(object sender, EventArgs e)
- {
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment