Gorsel Programlama | Görsel Programlama | C#.Net | VB.Net | C# Console

ana sayfa > C#, Görsel Programlama > Rastgele Kullanıcı Belirleme C#

Rastgele Kullanıcı Belirleme C#

Pazartesi, 08 Mar 2010 yorum ekle yorumlara git

Rasgele Kullanıcı Belirleme C#

sans1



public partial class Form1 : Form
{
ArrayList tc = new ArrayList();
string aranan;
int yer = -1;

Random ras = new Random();
public Form1()
{
InitializeComponent();
}

private void button1_Click(object sender, EventArgs e)
{
tc.Add(textBox1.Text+textBox2.Text.PadLeft(10)+textBox3.Text.PadLeft(15)+maskedTextBox1.Text.PadLeft(20));

}

private void button2_Click(object sender, EventArgs e)
{
listBox1.Items.Clear();
foreach (string numara in tc)
{
listBox1.Items.Add(numara);
}

}

private void button3_Click(object sender, EventArgs e)
{
int sayi;

sayi = ras.Next(tc.Count);

MessageBox.Show("Kayıtlar Arasından " + tc[sayi].ToString()+ " numaralı kullanıcı şanslı kullanıcı olarak seçilmiştir");

}

private void button4_Click(object sender, EventArgs e)
{
listBox1.Items.Remove(listBox1.SelectedItem);
}

private void button5_Click(object sender, EventArgs e)
{
aranan=textBox4.Text;
yer=listBox1.FindStringExact(aranan);
if (yer < 0)
{
yer = listBox1.FindString(aranan);
if (yer < 0)
MessageBox.Show("Bulunamadı");
}
if (yer >= 0)
listBox1.SelectedIndex = yer;

}

private void button6_Click(object sender, EventArgs e)
{
if (yer < listBox1.Items.Count - 1)
{
yer = listBox1.FindString(aranan, yer);
if (yer >= 0)
listBox1.SelectedIndex = yer;
}
}
} 


Projeyi İNDİR








Rica: Sitemizin Google'da Ön Sıralarda Çıkması İçin Lütfen Alttaki Google+ Butonuna Tıklayınız , Sayfamızı Facebookta Beğeniniz veya yazıları Twitter,Facebookta paylaşınız.
Paylaş :



Böyle bir web sayfam olsun diyorsanız iletişim bölümünden veya gorselprogram@gmail.com mail adresinden bize ulaşabilirsiniz.


  1. şimdilik yorum yok.
  1. şimdilik geri bağlantı yok