CodeRoot etiketine sahip kayıtlar gösteriliyor. Tüm kayıtları göster
CodeRoot etiketine sahip kayıtlar gösteriliyor. Tüm kayıtları göster
29 Eylül 2016 Perşembe
9 Ağustos 2016 Salı
3 Haziran 2016 Cuma
C# Sözlük Yapımı Access Veri Tabanlı
Haziran 03, 2016
@SiberÇocuk, Access, C#, CodeRoot, Sözlük, Veri Tabanı, Yapımı Program Kodları
Yorum yok

Form1 Kodları:
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 Tr_Ing_Sozluk
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
OleDbConnection baglanti = new OleDbConnection("Provider=Microsoft.ACE.OLEDB.12.0;Data Source=Sozluk.accdb;");
private void textBox1_TextChanged(object sender, EventArgs e)
{
if (radioButton1.Checked && textBox1.Text != "")
{
Tr_Ing_Ara(textBox1.Text);
}
else if (radioButton2.Checked && textBox1.Text != "")
{
Ing_Tr_Ara(textBox1.Text);
}
}
private void Tr_Ing_Ara(string kelime)
{
listBox1.Items.Clear();
try
{
if (baglanti.State != ConnectionState.Open)
baglanti.Open();
OleDbCommand komut = new OleDbCommand("Select * From Kelimeler Where Turkce Like '%"+kelime+"%'", baglanti);
OleDbDataReader oku = komut.ExecuteReader();
while (oku.Read())
{
listBox1.Items.Add(oku["Ingilizce"].ToString());
}
}
catch (Exception ex)
{
MessageBox.Show(ex.Message, "HATA", MessageBoxButtons.OK, MessageBoxIcon.Error);
}
finally
{
if (baglanti.State != ConnectionState.Closed)
baglanti.Close();
}
}
private void Ing_Tr_Ara(string kelime)
{
listBox1.Items.Clear();
try
{
if (baglanti.State != ConnectionState.Open)
baglanti.Open();
OleDbCommand komut = new OleDbCommand("Select * From Kelimeler Where Ingilizce Like '%" + kelime + "%'", baglanti);
OleDbDataReader oku = komut.ExecuteReader();
while (oku.Read())
{
listBox1.Items.Add(oku["Turkce"].ToString());
}
}
catch (Exception ex)
{
MessageBox.Show(ex.Message, "HATA", MessageBoxButtons.OK, MessageBoxIcon.Error);
}
finally
{
if (baglanti.State != ConnectionState.Closed)
baglanti.Close();
}
}
private void radioButton1_CheckedChanged(object sender, EventArgs e)
{
label1.Text = "Kelime:";
this.Text = "Sözlük Türkçe-İngilizce";
}
private void radioButton2_CheckedChanged(object sender, EventArgs e)
{
label1.Text = "Word:";
this.Text = "Sözlük İngilizce-Türkçe";
}
private void toolStripButton1_Click(object sender, EventArgs e)
{
KelimeEkle frm = new KelimeEkle();
if (frm.ShowDialog() == DialogResult.OK)
{
if (frm.Tr == "" || frm.Ing == "")
{
MessageBox.Show("Alanları Boş Geçmeyiniz!!!.", "Bilgi", MessageBoxButtons.OK, MessageBoxIcon.Information);
return;
}
try
{
if (baglanti.State != ConnectionState.Open)
baglanti.Open();
OleDbCommand komut = new OleDbCommand("Insert Into Kelimeler (Turkce,Ingilizce) Values('" + frm.Tr + "','" + frm.Ing + "')", baglanti);
komut.ExecuteNonQuery();
MessageBox.Show("Kelimeler Eklendi.", "Bilgi", MessageBoxButtons.OK, MessageBoxIcon.Information);
}
catch (Exception ex)
{
MessageBox.Show(ex.Message, "HATA", MessageBoxButtons.OK, MessageBoxIcon.Error);
}
finally
{
if (baglanti.State != ConnectionState.Closed)
baglanti.Close();
}
}
}
private void toolStripButton2_Click(object sender, EventArgs e)
{
MessageBox.Show("Made By Fikri KOCAOĞLAN","Hazırlayan",MessageBoxButtons.OK,MessageBoxIcon.Information);
}
private void linkLabel1_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
{
System.Diagnostics.Process.Start("http://csharp-uygulamalari.blogspot.com.tr/");
}
}
}
Form2 Kodları:
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 Tr_Ing_Sozluk
{
public partial class KelimeEkle : Form
{
public KelimeEkle()
{
InitializeComponent();
}
public string Tr
{
get { return textBox1.Text; }
set { textBox1.Text = value; }
}
public string Ing
{
get { return textBox2.Text; }
set { textBox2.Text = value; }
}
private void button1_Click(object sender, EventArgs e)
{
DialogResult = DialogResult.OK;
}
private void button2_Click(object sender, EventArgs e)
{
DialogResult = DialogResult.Cancel;
}
}
}
Veri Tabanı Görüntüsü:
2 Haziran 2016 Perşembe
10 Nisan 2016 Pazar
C# Ay Gün ve Yıl Hesaplayan Program
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 Tarih_Hesabi
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private void button1_Click(object sender, EventArgs e)
{
if (textBox1.Text != "" || textBox2.Text != "" || textBox3.Text != "")
{
int d_Gun, d_Ay, d_Yil;
d_Gun = Convert.ToInt32(textBox1.Text);
d_Ay = Convert.ToInt32(textBox2.Text);
d_Yil = Convert.ToInt32(textBox3.Text);
int s_Gun, s_Ay, s_Yil;
s_Gun = Convert.ToInt32(DateTime.Now.Day);
s_Ay = Convert.ToInt32(DateTime.Now.Month);
s_Yil = Convert.ToInt32(DateTime.Now.Year);
int gun, ay, yil, toplam_Ay, toplam_Gun, toplam_Saat;
if ((d_Gun >= 1 && d_Gun <= 31) && (d_Ay >= 1 && d_Ay <= 12) && (d_Yil <= s_Yil))
{
if (d_Gun <= s_Gun)
{
gun = s_Gun - d_Gun;
}
else
{
gun = (s_Gun + 30) - d_Gun;
s_Ay--;
}
if (d_Ay <= s_Ay)
{
ay = s_Ay - d_Ay;
}
else
{
ay = (s_Ay + 12) - d_Ay;
s_Yil--;
}
yil = s_Yil - d_Yil;
toplam_Ay = (yil * 12) + ay;
toplam_Gun = (toplam_Ay * 30) + gun;
toplam_Saat = toplam_Gun * 24;
MessageBox.Show("Sen Doğalı " + yil + " Yıl " + ay + " Ay " + gun + " Gün Oldu...\nSen Doğalı Toplam " + toplam_Ay + " Ay Oldu...\nSen Doğalı Toplam " + toplam_Gun + " Gün Oldu...\nSen Doğalı Toplam " + toplam_Saat + " Saat Oldu...", "Sonuç", MessageBoxButtons.OK, MessageBoxIcon.Information);
textBox1.Clear();
textBox2.Clear();
textBox3.Clear();
textBox1.Focus();
}
else
{
MessageBox.Show("Hatalı Giriş Yaptınız Lütfen Kontrol Ediniz!!!", "Hata", MessageBoxButtons.OK, MessageBoxIcon.Error);
}
}
else
{
textBox1.Focus();
}
}
private void textBox1_TextChanged(object sender, EventArgs e)
{
if (textBox1.Text.Length == 2) textBox2.Focus();
}
private void textBox2_TextChanged(object sender, EventArgs e)
{
if (textBox2.Text.Length == 2) textBox3.Focus();
}
private void textBox3_TextChanged(object sender, EventArgs e)
{
if (textBox3.Text.Length == 4) button1.Focus();
}
private void linkLabel1_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
{
System.Diagnostics.Process.Start("http://csharp-uygulamalari.blogspot.com/");
}
private void timer1_Tick(object sender, EventArgs e)
{
label6.Text = label6.Text.Substring(1) + label6.Text.Substring(0, 1);
}
private void Form1_Load(object sender, EventArgs e)
{
label6.Text = " Hazırlayan Fikri KOCAOĞLAN ";
}
}
}


