티스토리 뷰

카테고리 없음

c# 랜덤숫자생성

뽀로로친구에디 2019. 1. 23. 11:37

  //카운트

            count++;

            this.textBox1.Text = count.ToString();

            this.textBox2.Text = count.ToString();

            this.textBox3.Text = count.ToString();

            this.textBox4.Text = count.ToString();

            this.textBox5.Text = count.ToString();

            this.textBox6.Text = count.ToString();

            this.textBox7.Text = count.ToString();

            this.textBox8.Text = count.ToString();

            this.textBox9.Text = count.ToString();

            this.textBox10.Text = count.ToString();


            //랜덤 측정치

            Random r = new Random();

            this.textBox1_data1.Text = r.Next(100, 110).ToString();

            this.textBox2_data1.Text = r.Next(100, 110).ToString();

            this.textBox3_data1.Text = r.Next(100, 110).ToString();

            this.textBox4_data1.Text = r.Next(100, 110).ToString();

            this.textBox5_data1.Text = r.Next(100, 110).ToString();

            this.textBox6_data1.Text = r.Next(100, 110).ToString();

            this.textBox7_data1.Text = r.Next(100, 110).ToString();

            this.textBox8_data1.Text = r.Next(100, 110).ToString();

            this.textBox9_data1.Text = r.Next(100, 110).ToString();

            this.textBox10_data1.Text = r.Next(100, 110).ToString();



// Radom class:

Random r = new Random();


// Methods:


r.Next();                             // 랜덤값 생성


r.Next(Int32 min, Int32 max);  // 최소 min 값 부터 최대 max - 1 까지


int i;

   Random r = new Random();

  

   for (i = 0; i < 10; i++)

   {

        Console.WriteLine("{0} = {1}", i + 1, r.Next(1, 100));

   }


댓글
최근에 달린 댓글
글 보관함
«   2025/02   »
1
2 3 4 5 6 7 8
9 10 11 12 13 14 15
16 17 18 19 20 21 22
23 24 25 26 27 28
Total
Today
Yesterday
    뽀로로친구에디
    최근에 올라온 글