kim 500 bin ister c# oyunu etiketine sahip kayıtlar gösteriliyor. Tüm kayıtları göster
kim 500 bin ister c# oyunu etiketine sahip kayıtlar gösteriliyor. Tüm kayıtları göster

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;
        }
    }
}

8 Mart 2012 Perşembe

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";
            }
        }
    }
}