vs 2008 projeleri etiketine sahip kayıtlar gösteriliyor. Tüm kayıtları göster
vs 2008 projeleri etiketine sahip kayıtlar gösteriliyor. Tüm kayıtları göster

11 Nisan 2012 Çarşamba

C# Access Random Sayıyla Hedefe Ulaşmak(Timer)



Formun Tamamı İçin Tıklayınız.




# BUTON İÇİ #



using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace WindowsFormsApplication57
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
        }

        int sayac = 33;
        Class1 nalan = new Class1();

        void gonder()
        {
            nalan.okulnno = textBox1.Text;
            nalan.ad = textBox2.Text;
            nalan.saniye = label3.Text;
        }
        private void button1_Click(object sender, EventArgs e)
        {
            sayac = 33;
            timer1.Stop();
            Class1 nalan = new Class1();
            if (nalan.m == 1)
            {
                textBox1.Clear();
                textBox1.Focus();
            }
            if (nalan.m == 0)
            {
                nalan.elif();//sayılar geliyor...
                button2.Text = nalan.sayilar[0].ToString();
                button3.Text = nalan.sayilar[1].ToString();
                button4.Text = nalan.sayilar[2].ToString();
                button5.Text = nalan.sayilar[3].ToString();
                button6.Text = nalan.sayilar[4].ToString();
                button7.Text = nalan.sayilar[5].ToString();
                button8.Text = nalan.sayilar[6].ToString();
                button9.Text = nalan.sayilar[7].ToString();
                button10.Text = nalan.sayilar[8].ToString();
                label4.Text = nalan.sayilar[9].ToString();          
                timer1.Start();
            }
        }

        private void button8_Click(object sender, EventArgs e)
        {
            if (radioButton1.Checked)
            {
                nalan.hedef = label4.Text;
                nalan.say = int.Parse(button8.Text);
                nalan.toplama();
                label5.Text = nalan.sonuc.ToString();
                if (nalan.zaman == 1)
                {
                    timer1.Stop();
                    gonder();
                    nalan.yaz();
                    MessageBox.Show("Tebrikler başardınız...");              
                }
            }                
        }

        private void timer1_Tick(object sender, EventArgs e)
        {
            sayac -= 1;
            label3.Text = sayac.ToString();
            if (sayac == 0)
            {
                timer1.Stop();
                button2.Enabled = false;
                MessageBox.Show("Süreniz doldu...");
            }
        }

        private void button2_Click(object sender, EventArgs e)
        {
            if (radioButton1.Checked)
            {
                nalan.hedef = label4.Text;
                nalan.say = int.Parse(button2.Text);
                nalan.toplama();
                label5.Text = nalan.sonuc.ToString();
                if (nalan.zaman == 1)
                {
                    timer1.Stop();
                    gonder();
                    nalan.yaz();
                    MessageBox.Show("Tebrikler başardınız...");
                }
            }
        }

        private void button3_Click(object sender, EventArgs e)
        {
            if (radioButton1.Checked)
            {
                nalan.hedef = label4.Text;
                nalan.say = int.Parse(button3.Text);
                nalan.toplama();
                label5.Text = nalan.sonuc.ToString();
                if (nalan.zaman == 1)
                {
                    timer1.Stop();
                    gonder();
                    nalan.yaz();
                    MessageBox.Show("Tebrikler başardınız...");
                }
            }
        }

        private void button4_Click(object sender, EventArgs e)
        {
            if (radioButton1.Checked)
            {
                nalan.hedef = label4.Text;
                nalan.say = int.Parse(button4.Text);
                nalan.toplama();
                label5.Text = nalan.sonuc.ToString();
                if (nalan.zaman == 1)
                {
                    timer1.Stop();
                    gonder();
                    nalan.yaz();
                    MessageBox.Show("Tebrikler başardınız...");
                }
            }
        }

        private void button7_Click(object sender, EventArgs e)
        {
            if (radioButton1.Checked)
            {
                nalan.hedef = label4.Text;
                nalan.say = int.Parse(button7.Text);
                nalan.toplama();
                label5.Text = nalan.sonuc.ToString();
                if (nalan.zaman == 1)
                {
                    timer1.Stop();
                    gonder();
                    nalan.yaz();
                    MessageBox.Show("Tebrikler başardınız...");
                }
            }
        }

        private void button6_Click(object sender, EventArgs e)
        {
            if (radioButton1.Checked)
            {
                nalan.hedef = label4.Text;
                nalan.say = int.Parse(button6.Text);
                nalan.toplama();
                label5.Text = nalan.sonuc.ToString();
                if (nalan.zaman == 1)
                {
                    timer1.Stop();
                    gonder();
                    nalan.yaz();
                    MessageBox.Show("Tebrikler başardınız...");
                }
            }
        }

        private void button5_Click(object sender, EventArgs e)
        {
            if (radioButton1.Checked)
            {
                nalan.hedef = label4.Text;
                nalan.say = int.Parse(button5.Text);
                nalan.toplama();
                label5.Text = nalan.sonuc.ToString();
                if (nalan.zaman == 1)
                {
                    timer1.Stop();
                    gonder();
                    nalan.yaz();
                    MessageBox.Show("Tebrikler başardınız...");
                }
            }
        }

        private void button10_Click(object sender, EventArgs e)
        {
            if (radioButton1.Checked)
            {
                nalan.hedef = label4.Text;
                nalan.say = int.Parse(button10.Text);
                nalan.toplama();
                label5.Text = nalan.sonuc.ToString();
                if (nalan.zaman == 1)
                {
                    timer1.Stop();
                    gonder();
                    nalan.yaz();
                    MessageBox.Show("Tebrikler başardınız...");
                }
            }
        }

        private void button9_Click(object sender, EventArgs e)
        {
            if (radioButton1.Checked)
            {
                nalan.hedef = label4.Text;
                nalan.say = int.Parse(button9.Text);
                nalan.toplama();
                label5.Text = nalan.sonuc.ToString();
                if (nalan.zaman == 1)
                {
                    timer1.Stop();
                    gonder();
                    nalan.yaz();
                    MessageBox.Show("Tebrikler başardınız...");
                }
            }
        }

        private void button11_Click(object sender, EventArgs e)
        {
            nalan.listele(this);
        }
    }
}












# CLASS İÇİ #

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Data.OleDb;
using System.Data;
using System.Collections;
using System.Windows.Forms;

namespace WindowsFormsApplication57
{
    class Class1
    {
        OleDbConnection con = new OleDbConnection("provider=microsoft.jet.oledb.4.0;data source=okul.mdb");
        public string okulnno,ad;   
        public int m=0;
        public ArrayList sayilar=new ArrayList();
        public int sonuc;
        public int say;
        public string hedef;
        public int zaman=0;
        public string saniye;
        public void yaz()
        {
            con.Open();
            OleDbDataAdapter da = new OleDbDataAdapter("select * from meltem", con);
            OleDbCommand cmd = new OleDbCommand("insert into meltem(okulno,ad,saniye) values('" + okulnno + "','" + ad + "','"+saniye+"')", con);
            DataSet ds = new DataSet();
            da.Fill(ds, "pakize");
            int k = ds.Tables[0].Rows.Count;
            for (int i = 0; i < k; i++)
            {
                if (okulnno == ds.Tables[0].Rows[i][0].ToString())
                {
                    m = 1;
                }
            }
            if (m == 1)
            {
                MessageBox.Show("Başka okul no giriniz");
            }
            else
            {
                cmd.ExecuteNonQuery();
            }
            con.Close();
        }
        public void elif()
        {
            Random rasgele = new Random();
            for (int j = 1; j <= 9; j++)
            {
                int c = rasgele.Next(0, 9);
                sayilar.Add(c);
            }
            int d = rasgele.Next(50, 90);
            sayilar.Add(d);//hedef sayı arraylistin sonunda...
        }

        public void toplama()
        {
            sonuc = sonuc + say;
            if (hedef == sonuc.ToString())
            {
                zaman = 1;                           
            }         
        }

        public void listele(Form1 okul)
        {
            okul.listBox1.Items.Clear();
            int m=0;
            con.Open();
            OleDbDataAdapter da = new OleDbDataAdapter("select * from meltem order by saniye desc", con);
            DataSet ds = new DataSet();
            da.Fill(ds, "pakize");
            int k = ds.Tables[0].Rows.Count;
            for (int i = 0; i < k; i++)
            {
                okul.listBox1.Items.Add(++m + ")" + ds.Tables[0].Rows[i][0] + " " + ds.Tables[0].Rows[i][1] + " " + ds.Tables[0].Rows[i][2]);

            }
        }
    }
}

27 Mart 2012 Salı

C# Sayı Bulmak


Formun Tamamı İçin Tıklayınız.

EMİR ÖZBEY



using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace WindowsFormsApplication2
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
        }
        string ad;
        int p = 0;
        int h = 20;
        double m, q, w, f, ı, g, d,o;
        double sonuc = 0;
     
        int v=0;
        void mesaj()
        {
            if (sonuc == Convert.ToInt32(textBox3.Text))
            {
                p = p + 10;
                label3.Text = p.ToString();
                listBox1.Items.Add(++v + ")" + sonuc + " " + "Doğru" + " " + textBox3.Text + " " + "Doğru");
            }
            else
            {
                p = p - 10;
                label3.Text = p.ToString();
                listBox1.Items.Add(++v + ")" + sonuc + " " + "Doğru" + " " + textBox3.Text + " " + "Yanlış");
            }
        }

        private void button1_Click(object sender, EventArgs e)
        {
            m = Convert.ToInt32(textBox1.Text);
            q = Convert.ToInt32(textBox2.Text);
            sonuc = m + q;
            mesaj();
            listBox1.BackColor = Color.Red;    
        }

        private void button5_Click(object sender, EventArgs e)
        {
            Random a=new Random();
            int k = a.Next(1, 25);
            int k1 = a.Next(1, 25);
            textBox1.Text=k.ToString();
            textBox2.Text = k1.ToString();      
        }

        private void button2_Click(object sender, EventArgs e)
        {          
            w = Convert.ToInt32(textBox1.Text);
            f = Convert.ToInt32(textBox2.Text);
            sonuc = w - f;
            mesaj();
            listBox1.BackColor = Color.Yellow;        
        }

        private void button3_Click(object sender, EventArgs e)
        {
            listBox1.Items.Clear();
            ı = Convert.ToInt32(textBox1.Text);
            o = Convert.ToInt32(textBox2.Text);
            sonuc =(ı / o);
            mesaj();
            listBox1.BackColor = Color.Blue;        
        }

        private void button4_Click(object sender, EventArgs e)
        {        
            g = Convert.ToInt32(textBox1.Text);
            d = Convert.ToInt32(textBox2.Text);
            sonuc = g * d;
            mesaj();
            listBox1.BackColor = Color.Green;          
        }

        private void timer1_Tick(object sender, EventArgs e)
        {
            h = h - 1;
            label2.Visible = true;
            label2.Text = h.ToString();
            if(h==0)
            {
                panel1.Visible = false;
                label1.Enabled = false;
                label2.Enabled = false;
                label3.Enabled = false;
                listBox1.Enabled = false;
                button1.Enabled = false;
                button2.Enabled = false;
                button3.Enabled = false;
                button4.Enabled = false;
                textBox1.Enabled= false;
                textBox2.Enabled = false;
                textBox3.Enabled = false;
                listBox1.Items.Add(ad+" "+"Puanınız"+" "+p);
                listBox2.Items.Add(ad + " " + "Puanınız" + " " + p);
                timer1.Stop();
                label2.Visible = false;
            }
        }

        private void Form1_Load(object sender, EventArgs e)
        {          
            label3.Text = p.ToString();        
        }

        private void button6_Click(object sender, EventArgs e)
        {
            label1.Enabled = false;
            label2.Enabled = false;
            label3.Enabled = false;
            listBox1.Enabled = false;
            button1.Enabled = false;
            button2.Enabled = false;
            button3.Enabled = false;
            button4.Enabled = false;
            textBox1.Enabled = false;
            textBox2.Enabled = false;
            textBox3.Enabled = false;
            textBox3.Clear();
            textBox4.Clear();
            p = 0;
            listBox1.Items.Clear();
            h = 20;
            timer1.Start();
            ad = textBox4.Text;
            panel1.Visible = true;
        }

        private void button7_Click(object sender, EventArgs e)
        {
            listBox1.Visible = true;
        }
    }
}

21 Mart 2012 Çarşamba

4 İşlem Kullanarak Sayıya Ulaşmak


Formun Tamamı İçin Tıklayınız.



using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace WindowsFormsApplication48
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
        }
        int a;
        int süre = 0;
        private void button13_Click(object sender, EventArgs e)
        {
            a = 0;
            süre = 0;
            textBox1.Text = "0";
            textBox2.Text = "0";
            timer1.Start();
            Random rd = new Random();
            int sayi1 = rd.Next(1, 20);
            int sayi2 = rd.Next(1, 20);
            int sayi3 = rd.Next(1, 20);
            int sayi4 = rd.Next(1, 20);
            int sayi5 = rd.Next(1, 20);
            int sayi6 = rd.Next(1, 20);
            int sayi7 = rd.Next(1, 20);
            int sayi8 = rd.Next(1, 20);
            int sayi9 = rd.Next(1, 20);
            int sayi10= rd.Next(1, 20);
            int sayi11 = rd.Next(1, 20);
            int sayi12 = rd.Next(1, 20);
            int hedef = rd.Next(50, 200);
            button1.Text = sayi1.ToString();
            button2.Text = sayi2.ToString();
            button3.Text = sayi3.ToString();
            button4.Text = sayi4.ToString();
            button5.Text = sayi5.ToString();
            button6.Text = sayi6.ToString();
            button7.Text = sayi7.ToString();
            button8.Text = sayi8.ToString();
            button9.Text = sayi9.ToString();
            button10.Text = sayi10.ToString();
            button11.Text = sayi11.ToString();
            button12.Text = sayi12.ToString();
            textBox1.Text = hedef.ToString();
            label3.Visible = true;
            button1.Enabled = true;
            button2.Enabled = true;
            button3.Enabled = true;
            button4.Enabled = true;
            button5.Enabled = true;
            button6.Enabled = true;
            button7.Enabled = true;
            button8.Enabled = true;
            button9.Enabled = true;
            button10.Enabled = true;
            button11.Enabled = true;
            button12.Enabled = true;
        }
        public void metod()
        {
            if (a == Convert.ToInt32(textBox1.Text))
            {
                MessageBox.Show("Bravoo");
            }
        }
        private void button1_Click(object sender, EventArgs e)
        {
            if (radioButton1.Checked)
            {
                a = a + Convert.ToInt32(button1.Text);
                textBox2.Text = a.ToString();
                metod();
            }
            if (radioButton2.Checked)
            {
                a = a - Convert.ToInt32(button1.Text);
                textBox2.Text = a.ToString();
                metod();
            }
            if (radioButton3.Checked)
            {
                a = a * Convert.ToInt32(button1.Text);
                textBox2.Text = a.ToString();
                metod();
            }
            if (radioButton4.Checked)
            {
                a = a / Convert.ToInt32(button1.Text);
                textBox2.Text = a.ToString();
                metod();
            }
            button1.Enabled = false;
        }

        private void button2_Click(object sender, EventArgs e)
        {
            if (radioButton1.Checked)
            {
                a = a + Convert.ToInt32(button2.Text);
                textBox2.Text = a.ToString();
                metod();
            }
            if (radioButton2.Checked)
            {
                a = a - Convert.ToInt32(button2.Text);
                textBox2.Text = a.ToString();
                metod();
            }
            if (radioButton3.Checked)
            {
                a = a * Convert.ToInt32(button2.Text);
                textBox2.Text = a.ToString();
                metod();
            }
            if (radioButton4.Checked)
            {
                a = a / Convert.ToInt32(button2.Text);
                textBox2.Text = a.ToString();
                metod();
            }
            button2.Enabled = false;
        }

        private void button3_Click(object sender, EventArgs e)
        {
            if (radioButton1.Checked)
            {
                a = a + Convert.ToInt32(button3.Text);
                textBox2.Text = a.ToString();
                metod();
            }
            if (radioButton2.Checked)
            {
                a = a - Convert.ToInt32(button3.Text);
                textBox2.Text = a.ToString();
                metod();
            }
            if (radioButton3.Checked)
            {
                a = a * Convert.ToInt32(button3.Text);
                textBox2.Text = a.ToString();
                metod();
            }
            if (radioButton4.Checked)
            {
                a = a / Convert.ToInt32(button3.Text);
                textBox2.Text = a.ToString();
                metod();
            }
            button3.Enabled = false;
        }

        private void button4_Click(object sender, EventArgs e)
        {
            if (radioButton1.Checked)
            {
                a = a + Convert.ToInt32(button4.Text);
                textBox2.Text = a.ToString();
                metod();
            }
            if (radioButton2.Checked)
            {
                a = a - Convert.ToInt32(button4.Text);
                textBox2.Text = a.ToString();
                metod();
            }
            if (radioButton3.Checked)
            {
                a = a * Convert.ToInt32(button4.Text);
                textBox2.Text = a.ToString();
                metod();
            }
            if (radioButton4.Checked)
            {
                a = a / Convert.ToInt32(button4.Text);
                textBox2.Text = a.ToString();
                metod();
            }
            button4.Enabled = false;
        }

        private void button5_Click(object sender, EventArgs e)
        {
            if (radioButton1.Checked)
            {
                a = a + Convert.ToInt32(button5.Text);
                textBox2.Text = a.ToString();
                metod();
            }
            if (radioButton2.Checked)
            {
                a = a - Convert.ToInt32(button5.Text);
                textBox2.Text = a.ToString();
                metod();
            }
            if (radioButton3.Checked)
            {
                a = a * Convert.ToInt32(button5.Text);
                textBox2.Text = a.ToString();
                metod();
            }
            if (radioButton4.Checked)
            {
                a = a / Convert.ToInt32(button5.Text);
                textBox2.Text = a.ToString();
                metod();
            }
            button5.Enabled = false;
        }

        private void button6_Click(object sender, EventArgs e)
        {
            if (radioButton1.Checked)
            {
                a = a + Convert.ToInt32(button6.Text);
                textBox2.Text = a.ToString();
                metod();
            }
            if (radioButton2.Checked)
            {
                a = a - Convert.ToInt32(button6.Text);
                textBox2.Text = a.ToString();
                metod();
            }
            if (radioButton3.Checked)
            {
                a = a * Convert.ToInt32(button6.Text);
                textBox2.Text = a.ToString();
                metod();
            }
            if (radioButton4.Checked)
            {
                a = a / Convert.ToInt32(button6.Text);
                textBox2.Text = a.ToString();
                metod();
            }
            button6.Enabled = false;
        }

        private void button7_Click(object sender, EventArgs e)
        {
            if (radioButton1.Checked)
            {
                a = a + Convert.ToInt32(button7.Text);
                textBox2.Text = a.ToString();
                metod();
            }
            if (radioButton2.Checked)
            {
                a = a - Convert.ToInt32(button7.Text);
                textBox2.Text = a.ToString();
                metod();
            }
            if (radioButton3.Checked)
            {
                a = a * Convert.ToInt32(button7.Text);
                textBox2.Text = a.ToString();
                metod();
            }
            if (radioButton4.Checked)
            {
                a = a / Convert.ToInt32(button7.Text);
                textBox2.Text = a.ToString();
                metod();
            }
            button7.Enabled = false;
        }

        private void button8_Click(object sender, EventArgs e)
        {
            if (radioButton1.Checked)
            {
                a = a + Convert.ToInt32(button8.Text);
                textBox2.Text = a.ToString();
                metod();
            }
            if (radioButton2.Checked)
            {
                a = a - Convert.ToInt32(button8.Text);
                textBox2.Text = a.ToString();
                metod();
            }
            if (radioButton3.Checked)
            {
                a = a * Convert.ToInt32(button8.Text);
                textBox2.Text = a.ToString();
                metod();
            }
            if (radioButton4.Checked)
            {
                a = a / Convert.ToInt32(button8.Text);
                textBox2.Text = a.ToString();
                metod();
            }
            button8.Enabled = false;
        }

        private void button9_Click(object sender, EventArgs e)
        {
            if (radioButton1.Checked)
            {
                a = a + Convert.ToInt32(button9.Text);
                textBox2.Text = a.ToString();
                metod();
            }
            if (radioButton2.Checked)
            {
                a = a - Convert.ToInt32(button9.Text);
                textBox2.Text = a.ToString();
                metod();
            }
            if (radioButton3.Checked)
            {
                a = a * Convert.ToInt32(button9.Text);
                textBox2.Text = a.ToString();
                metod();
            }
            if (radioButton4.Checked)
            {
                a = a / Convert.ToInt32(button9.Text);
                textBox2.Text = a.ToString();
                metod();
            }
            button9.Enabled = false;
        }

        private void button10_Click(object sender, EventArgs e)
        {
            if (radioButton1.Checked)
            {
                a = a + Convert.ToInt32(button10.Text);
                textBox2.Text = a.ToString();
                metod();
            }
            if (radioButton2.Checked)
            {
                a = a - Convert.ToInt32(button10.Text);
                textBox2.Text = a.ToString();
                metod();
            }
            if (radioButton3.Checked)
            {
                a = a * Convert.ToInt32(button10.Text);
                textBox2.Text = a.ToString();
                metod();
            }
            if (radioButton4.Checked)
            {
                a = a / Convert.ToInt32(button10.Text);
                textBox2.Text = a.ToString();
                metod();
            }
            button10.Enabled = false;
        }

        private void button11_Click(object sender, EventArgs e)
        {
            if (radioButton1.Checked)
            {
                a = a + Convert.ToInt32(button11.Text);
                textBox2.Text = a.ToString();
                metod();
            }
            if (radioButton2.Checked)
            {
                a = a - Convert.ToInt32(button11.Text);
                textBox2.Text = a.ToString();
                metod();
            }
            if (radioButton3.Checked)
            {
                a = a * Convert.ToInt32(button11.Text);
                textBox2.Text = a.ToString();
                metod();
            }
            if (radioButton4.Checked)
            {
                a = a / Convert.ToInt32(button11.Text);
                textBox2.Text = a.ToString();
                metod();
            }
            button11.Enabled = false;
        }

        private void button12_Click(object sender, EventArgs e)
        {
            if (radioButton1.Checked)
            {
                a = a + Convert.ToInt32(button12.Text);
                textBox2.Text = a.ToString();
                metod();
            }
            if (radioButton2.Checked)
            {
                a = a - Convert.ToInt32(button12.Text);
                textBox2.Text = a.ToString();
                metod();
            }
            if (radioButton3.Checked)
            {
                a = a * Convert.ToInt32(button12.Text);
                textBox2.Text = a.ToString();
                metod();
            }
            if (radioButton4.Checked)
            {
                a = a / Convert.ToInt32(button12.Text);
                textBox2.Text = a.ToString();
                metod();
            }
            button12.Enabled = false;
        }

        private void timer1_Tick(object sender, EventArgs e)
        {
            label3.Text = süre.ToString();
            süre += 1;
            if (süre == 60)
            {
                timer1.Stop();
                panel1.Enabled = false;
                MessageBox.Show("süreniz doldu");
            }
        }

        private void Form1_Load(object sender, EventArgs e)
        {
            label3.Visible = false;
            label3.Text = "0";
        }
    }
}

20 Mart 2012 Salı

Visual Studio 2010 Projesini VS 2008 ' de Açmak



Visual Studio 2008 kullananlar için Visual Studio 2010 projesini normal yollardan açamayız. Aşağıdaki yöntemleri yaptıktan sonra 2008 projesiymiş gibi kullanabiliriz.






































8 Mart 2012 Perşembe

C# Access Bağlantısı Kullanıcıya Göre Listeleme

Formun Tamamı İçin Tıklayın.

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.Data.OleDb;

namespace WindowsFormsApplication1
{
    public partial class Form1 : Form
    {

        public Form1()
        {
            InitializeComponent();
        }
        int i = 0;
        int fb = 0;
        int gs = 0;
        int bjk = 0;
        int ts = 0;
        int a = 15;
        private void button1_Click(object sender, EventArgs e)
        {
            panel1.Visible = true;

        }

        private void Form1_Load(object sender, EventArgs e)
        {
            OleDbConnection emir = new OleDbConnection("provider=microsoft.jet.oledb.4.0;data source=e.mdb");
            emir.Open();
            OleDbDataAdapter emir3 = new OleDbDataAdapter("select*from emir2", emir);
            DataSet emir4 = new DataSet();
            emir3.Fill(emir4, "kitap");
            label3.Text = emir4.Tables[0].Rows[i][0].ToString();
            radioButton1.Text = emir4.Tables[0].Rows[i][1].ToString();
            radioButton2.Text = emir4.Tables[0].Rows[i][2].ToString();
            radioButton3.Text = emir4.Tables[0].Rows[i][3].ToString();
            radioButton4.Text = emir4.Tables[0].Rows[i][4].ToString();
            timer1.Start();
        }

        private void button2_Click(object sender, EventArgs e)
        {
            if (radioButton1.Checked)
            {
                textBox3.Text = "FB";
            }
            if (radioButton2.Checked)
            {
                textBox3.Text = "GS";
            }
            if (radioButton3.Checked)
            {
                textBox3.Text = "BJK";
            }
            if (radioButton4.Checked)
            {
                textBox3.Text = "TS";
            }
            OleDbConnection emir = new OleDbConnection("provider=microsoft.jet.oledb.4.0;data source=e.mdb");
            emir.Open();
            OleDbCommand emir2 = new OleDbCommand("insert into emir([no],[ad],[takım]) values('" + textBox1.Text + "','" + textBox2.Text + "','" + textBox3.Text + "')", emir);
            emir2.ExecuteNonQuery();
            textBox1.Clear();
            textBox2.Clear();

        }

        private void button3_Click(object sender, EventArgs e)
        {
            listBox1.Items.Clear();
            listBox2.Items.Clear();
            int m = 0;
            listBox1.Visible = true;
            listBox2.Visible = true;
            OleDbConnection emir = new OleDbConnection("provider=microsoft.jet.oledb.4.0;data source=e.mdb");
            emir.Open();
            OleDbDataAdapter emir3 = new OleDbDataAdapter("select*from emir", emir);
            DataSet emir4 = new DataSet();
            emir3.Fill(emir4, "kitap");
            int a = emir4.Tables[0].Rows.Count;
            for (int k = 0; k < a; k++)
            {
                if (emir4.Tables[0].Rows[k][2].ToString() == "FB")
                {
                    fb += 1;
                    listBox1.Items.Add(++m + ")" + emir4.Tables[0].Rows[k][0] + " " + emir4.Tables[0].Rows[k][1] + " " + emir4.Tables[0].Rows[k][2]);
                }
            }
            for (int k = 0; k < a; k++)
            {
                if (emir4.Tables[0].Rows[k][2].ToString() == "GS")
                {
                    gs += 1;
                    listBox1.Items.Add(++m + ")" + emir4.Tables[0].Rows[k][0] + " " + emir4.Tables[0].Rows[k][1] + " " + emir4.Tables[0].Rows[k][2]);
                }
            }
            for (int k = 0; k < a; k++)
            {
                if (emir4.Tables[0].Rows[k][2].ToString() == "BJK")
                {
                    bjk += 1;
                    listBox1.Items.Add(++m + ")" + emir4.Tables[0].Rows[k][0] + " " + emir4.Tables[0].Rows[k][1] + " " + emir4.Tables[0].Rows[k][2]);
                }
            }
            for (int k = 0; k < a; k++)
            {
                if (emir4.Tables[0].Rows[k][2].ToString() == "TS")
                {
                    ts += 1;
                    listBox1.Items.Add(++m + ")" + emir4.Tables[0].Rows[k][0] + " " + emir4.Tables[0].Rows[k][1] + " " + emir4.Tables[0].Rows[k][2]);
                }
            }
            int s = 0;
            int bol =  (100/ 6)*fb;
            int bol1 = (100 /6)*gs;
            int bol2 = (100 /6)*bjk;
            int bol3 = (100 /6)*ts;
            listBox2.Items.Add(++s+")"+"FB Oranı" + " " + bol);
            listBox2.Items.Add(++s+")"+"GS Oranı" + " " + bol1);
            listBox2.Items.Add(++s+")"+"BJK Oranı" + " " + bol2);
            listBox2.Items.Add(++s+")"+"TS Oranı" + " " + bol3);
        }

        private void timer1_Tick(object sender, EventArgs e)
        {
            a = a - 1;
            label4.Text = a.ToString();
            if (a == 0)
            {
                timer1.Stop();
                panel1.Enabled = false;
                panel2.Enabled = false;
            }
        }
    }
}

C# Access Bağlantısı ve Soru Cevaplandırma-Değiştirme ve Timer


Formun Tamamı İçin Tıklayınız.


using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.Data.OleDb;
using System.Collections;

namespace WindowsFormsApplication59
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
        }
        ArrayList say = new ArrayList();
        OleDbConnection con = new OleDbConnection("provider=microsoft.jet.oledb.4.0;data source=okul.mdb");
        int i = 0;
        int limit;
        int sure = 60;
        string[] cevaplar = new string[101];
        int g = 0;
        private void button1_Click(object sender, EventArgs e)
        {
            con.Open();
            OleDbDataAdapter da = new OleDbDataAdapter("select * from sinif", con);
            DataSet ds = new DataSet();
            da.Fill(ds, "pelin");      
            listBox1.Visible = true;
            listBox1.Items.Clear();
            int m=0;
            for (int j = 0; j < limit; j++)
            {
                if (ds.Tables[0].Rows[j][6].ToString() == cevaplar[j].ToString())
                {
                    listBox1.Items.Add(++m + ".soru DOĞRU");
                }
                else
                {
                    listBox1.Items.Add(++m + ".soru YANLIŞ");
                }
            }            
            con.Close();
        }

        private void Form1_Load(object sender, EventArgs e)
        {
            con.Open();
            OleDbDataAdapter da = new OleDbDataAdapter("select * from sinif", con);
            DataSet ds = new DataSet();
            da.Fill(ds, "pelin");
            label1.Text = ds.Tables[0].Rows[i][1].ToString();
            radioButton1.Text = ds.Tables[0].Rows[i][2].ToString();
            radioButton2.Text = ds.Tables[0].Rows[i][3].ToString();
            radioButton3.Text = ds.Tables[0].Rows[i][4].ToString();
            radioButton4.Text = ds.Tables[0].Rows[i][5].ToString();
            timer1.Start();                
            con.Close();
        }

        private void timer1_Tick(object sender, EventArgs e)
        {
            sure -= 1;
            label2.Text = sure.ToString();
            if (sure == 0)
            {
                timer1.Stop();
            }
        }

        private void button2_Click(object sender, EventArgs e)
        {
            i += 1;
            con.Open();
            OleDbDataAdapter da = new OleDbDataAdapter("select * from sinif", con);
            DataSet ds = new DataSet();
            da.Fill(ds, "pelin");
            limit = ds.Tables[0].Rows.Count;
            if (i >= limit)
            {
                MessageBox.Show("Sorular bitti kontrol et...");
                i = limit-1;
            }
            else
            {
                label1.Text = ds.Tables[0].Rows[i][1].ToString();
                radioButton1.Text = ds.Tables[0].Rows[i][2].ToString();
                radioButton2.Text = ds.Tables[0].Rows[i][3].ToString();
                radioButton3.Text = ds.Tables[0].Rows[i][4].ToString();
                radioButton4.Text = ds.Tables[0].Rows[i][5].ToString();
                g += 1;
            }        
            con.Close();
        }

        private void button3_Click(object sender, EventArgs e)
        {
            i -= 1;
            con.Open();
            OleDbDataAdapter da = new OleDbDataAdapter("select * from sinif", con);
            DataSet ds = new DataSet();
            da.Fill(ds, "pelin");
            if (i <= -1)
            {
                MessageBox.Show("Zaten ilk sorudasın...   ??????");
                i = 0;
            }
            else
            {
                label1.Text = ds.Tables[0].Rows[i][1].ToString();
                radioButton1.Text = ds.Tables[0].Rows[i][2].ToString();
                radioButton2.Text = ds.Tables[0].Rows[i][3].ToString();
                radioButton3.Text = ds.Tables[0].Rows[i][4].ToString();
                radioButton4.Text = ds.Tables[0].Rows[i][5].ToString();
                g -= 1;
            }
            con.Close();
        }

        private void button4_Click(object sender, EventArgs e)
        {
            if (radioButton1.Checked)
            {
                cevaplar[g] = "1";

            }
            if (radioButton2.Checked)
            {
                cevaplar[g] = "2";

            }
            if (radioButton3.Checked)
            {
                cevaplar[g] = "3";

            }
            if (radioButton4.Checked)
            {
                cevaplar[g] = "4";
            }
        }
    }
}