колян22 К колян22 Регистрация 5 Окт 2013 Сообщения 96 Репутация 0 Спасибо 0 Монет 0 6 Окт 2016 #1 P.s только начал изучать C# вот мой код: public partial class Form1 : Form { Random rnd = new Random(); public Form1() { InitializeComponent(); } private void label1_Click(object sender, EventArgs e) { } private void btn1_Click(object sender, EventArgs e) { long a = Convert.ToInt64(numericUpDown1.Value); string icode = ""; string ucode = ""; string zcode = ""; string scode = ""; string xcode = ""; string[] arr = { "0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "B", "C", "D", "F", "G", "H", "J", "K", "L", "M", "N", "P", "Q", "R", "S", "T", "V", "W", "X", "Z", "I", "A", "E", "U", "Y", "O" }; for (int i = 0; i < 5; i = i + 1) // ЕСЛИ ИЗМЕНИТЬ i + 1 на i++, то ничего не работает. { icode = icode + arr[rnd.Next(0, 36)]; ucode = ucode + arr[rnd.Next(0, 36)]; zcode = zcode + arr[rnd.Next(0, 36)]; scode = scode + arr[rnd.Next(0, 36)]; xcode = xcode + arr[rnd.Next(0, 36)]; } for (long g = 0; g < a; g = g +1) // ТУТ ВСЕ ТАКЖЕ, КАК С i { textBox1.Text = "" + ucode + "-" + zcode + "-" + scode + "-" + icode + "-" + xcode; textBox2.Text += "" + ucode + "-" + zcode + "-" + scode + "-" + icode + "-" + xcode + Environment.NewLine; } }
P.s только начал изучать C# вот мой код: public partial class Form1 : Form { Random rnd = new Random(); public Form1() { InitializeComponent(); } private void label1_Click(object sender, EventArgs e) { } private void btn1_Click(object sender, EventArgs e) { long a = Convert.ToInt64(numericUpDown1.Value); string icode = ""; string ucode = ""; string zcode = ""; string scode = ""; string xcode = ""; string[] arr = { "0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "B", "C", "D", "F", "G", "H", "J", "K", "L", "M", "N", "P", "Q", "R", "S", "T", "V", "W", "X", "Z", "I", "A", "E", "U", "Y", "O" }; for (int i = 0; i < 5; i = i + 1) // ЕСЛИ ИЗМЕНИТЬ i + 1 на i++, то ничего не работает. { icode = icode + arr[rnd.Next(0, 36)]; ucode = ucode + arr[rnd.Next(0, 36)]; zcode = zcode + arr[rnd.Next(0, 36)]; scode = scode + arr[rnd.Next(0, 36)]; xcode = xcode + arr[rnd.Next(0, 36)]; } for (long g = 0; g < a; g = g +1) // ТУТ ВСЕ ТАКЖЕ, КАК С i { textBox1.Text = "" + ucode + "-" + zcode + "-" + scode + "-" + icode + "-" + xcode; textBox2.Text += "" + ucode + "-" + zcode + "-" + scode + "-" + icode + "-" + xcode + Environment.NewLine; } }