21 Aralık 2013 Cumartesi

C# da Metod ile Random Kullanma

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 WindowsFormsApplication1
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}

private void button1_Click(object sender, EventArgs e)
{
üret();
}
void üret()
{
Random n1 = new Random();
label1.Text = n1.Next(1, 49).ToString();
label2.Text = n1.Next(1, 49).ToString();
label3.Text = n1.Next(1, 49).ToString();
label4.Text = n1.Next(1, 49).ToString();
label5.Text = n1.Next(1, 49).ToString();
label6.Text = n1.Next(1, 49).ToString();


}
}
}


0 yorum :

Yorum Gönder