24 Aralık 2015 Perşembe

17 Aralık 2015 Perşembe

C# Dosya ve Klasör Arama

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.IO;

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



        private void Form1_Load(object sender, EventArgs e)
        {

        }

        void DirSearch(string sDir)
        {
            try
            {
                foreach (string d in Directory.GetDirectories(sDir))
                {
                    foreach (string f in Directory.GetFiles(d, "*.exe"))
                    {
                        listBox1.Items.Add(f);
                    }
                    DirSearch(d);
                }
            }
            catch (System.Exception excpt)
            {
                MessageBox.Show(excpt.Message);
            }
        }

        private void button1_Click(object sender, EventArgs e)
        {
            DirSearch(textBox1.Text);
        }

        private void listBox1_SelectedIndexChanged(object sender, EventArgs e)
        {
            System.Diagnostics.Process.Start(listBox1.SelectedItem.ToString());
        }

        private void linkLabel1_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
        {
            System.Diagnostics.Process.Start("http://csharp-uygulamalari.blogspot.com.tr/");
        }
    }
}

Paylaş:

11 Aralık 2015 Cuma

C# Web Sitesinde veya Bir Metinde Kelime Arama




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.Net;
using System.IO;
using System.Xml;



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

        private void button1_Click(object sender, EventArgs e)
        {
            try
            {
                //http://csharp-uygulamalari.blogspot.com.tr/    Fikri Kocaoglan
                int sayac = 0;
                string metin = richTextBox1.Text;
                richTextBox1.Text = metin;
                string kelime = textBox2.Text;
                int konum = metin.IndexOf(kelime);
                if (textBox2.Text.Length == 0)
                {
                    label3.Text = "Lütfen Aranacak Kelimeyi Yazınız...";
                }
                else
                {
                 
                    while (konum < richTextBox1.Text.LastIndexOf(kelime))
                    {
                            richTextBox1.Find(kelime, konum, richTextBox1.TextLength, RichTextBoxFinds.None);
                            richTextBox1.SelectionBackColor = Color.Yellow;
                            konum = metin.IndexOf(kelime, konum + 1);
                            sayac++;
                     
                    }
                    richTextBox1.Find(kelime, konum, richTextBox1.TextLength, RichTextBoxFinds.None);
                    richTextBox1.SelectionBackColor = Color.Yellow;
                    label3.Text = "Bu Sayfanın Tamamında Aranılan Kelimeden " + (sayac+1).ToString() + " Tane Bulundu.";
                }
            }
            catch
            {
                int sayac = 0;
                string metin = richTextBox1.Text;
                richTextBox1.Text = metin;
                string kelime = textBox2.Text;
                int konum = metin.IndexOf(kelime);
                if (textBox2.Text.Length == 0)
                {
                    label3.Text = "Lütfen Aranacak Kelimeyi Yazınız...";
                }
                else
                {
                    try
                    {
                        while (konum != -1)
                        {
                            konum = metin.IndexOf(kelime, konum + 1);
                            richTextBox1.Find(kelime, konum, richTextBox1.TextLength, RichTextBoxFinds.None);
                            richTextBox1.SelectionBackColor = Color.Yellow;
                            sayac++;
                        }
                        richTextBox1.Find(kelime, konum, richTextBox1.TextLength, RichTextBoxFinds.None);
                        richTextBox1.SelectionBackColor = Color.Yellow;
                        label3.Text = "Bu Sayfanın Tamamında Aranılan Kelimeden " + (sayac + 1).ToString() + " Tane Bulundu.";
                    }
                    catch(Exception ex)
                    {
                        richTextBox1.Text = ex.Message;
                    }
                }

         
            }

        }

        private void button2_Click(object sender, EventArgs e)
        {
            try
            {
                //http://csharp-uygulamalari.blogspot.com.tr/ Fikri Kocaoglan
                string adres = textBox1.Text;
                WebRequest istek = HttpWebRequest.Create(adres);
                WebResponse cevap;
                cevap = istek.GetResponse();
                StreamReader donenBilgiler = new StreamReader(cevap.GetResponseStream());
                string gelen = donenBilgiler.ReadToEnd();
                int titleIndexBaslangici = gelen.IndexOf("<html>") + 6;
                int titleIndexBitisi = gelen.Substring(titleIndexBaslangici).IndexOf("</html>");
                richTextBox1.Text = gelen.Substring(titleIndexBaslangici, titleIndexBitisi);
            }
            catch
            {
                WebProxy wb = new WebProxy(WebProxy.GetDefaultProxy().Address);
                WebClient wc = new WebClient();
                wc.Proxy = wb;
                string site = wc.DownloadString(textBox1.Text);
                XmlDocument xd = new XmlDocument();
                xd.LoadXml(site);
                richTextBox1.Text = site;
            }
        }

    }
}

Paylaş:

C# Ekran Görüntüsünü PictureBox' a Aktarmak



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

        Bitmap bmp;
        Graphics gr;
        private void timer1_Tick(object sender, EventArgs e)
        {
            bmp = new Bitmap(Screen.PrimaryScreen.WorkingArea.Width, Screen.PrimaryScreen.WorkingArea.Height);
            gr = Graphics.FromImage(bmp);
            gr.CopyFromScreen(0, 0, 0, 0, new Size(bmp.Width, bmp.Height));
            pictureBox1.Image = bmp;
            pictureBox1.SizeMode = PictureBoxSizeMode.StretchImage;
        }

        private void button1_Click(object sender, EventArgs e)
        {
            timer1.Start();
        }

        private void button2_Click(object sender, EventArgs e)
        {
            timer1.Stop();
        }
        Random rnd = new Random();
        private void button3_Click(object sender, EventArgs e)
        {
            pictureBox1.Image.Save("C:/ekran" + rnd.Next(0,1000) + ".jpg");
        }

        private void linkLabel1_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
        {
            System.Diagnostics.Process.Start("http://csharp-uygulamalari.blogspot.com.tr/");
            MessageBox.Show("Hazırlayan: Fikri KOCAOĞLAN","Bilgi",MessageBoxButtons.OK,MessageBoxIcon.Information);
        }
    }
}

Programın Çalışması:

Paylaş:

29 Kasım 2015 Pazar

C# Hava Durumu Öğrenme



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.Net;
using System.IO;
using System.Text.RegularExpressions;



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

        private void Form1_Load(object sender, EventArgs e)
        {
            HavaDurumu("İstanbul");
        }
        private static string BilgiCek(string url)
        {
            StringBuilder sb = new StringBuilder();
            byte[] buf = new byte[8192];
            HttpWebRequest request = (HttpWebRequest)WebRequest.Create(url);
            HttpWebResponse response = (HttpWebResponse)request.GetResponse();
            Stream resStream = response.GetResponseStream();
            string tempString = null;
            int count = 0;
            do
            {
                count = resStream.Read(buf, 0, buf.Length);
                if (count != 0)
                {
                    tempString = Encoding.UTF8.GetString(buf, 0, count);
                    sb.Append(tempString);
                }
            }
            while (count > 0);
            return sb.ToString();
        }

        private static string ToClearText(string tarih)
        {
            return Regex.Replace(tarih, @"<(.|\n)*?>", string.Empty);
        }
        string deger,durum="";
        private void HavaDurumu(string gelen_Sehir)
        {
            string url = "http://www.mgm.gov.tr/tahmin/il-ve-ilceler.aspx?m=" + gelen_Sehir;
            string html = BilgiCek(url);
            deger = "";
            string havadurumu = @"<em class";
            int pos1 = html.IndexOf(havadurumu);
            int pos2 = html.IndexOf("</em>", pos1);
            string derece = html.Substring(pos1, pos2 - pos1);
            string sondurum = @"/FILES/img";
            int pos5 = html.IndexOf(sondurum);
            int pos6 = html.IndexOf(".png", pos5);
            string sdurum = html.Substring(pos5, pos6 - pos5);
            sdurum = ToClearText(sdurum);
            string resim = sdurum + ".png";
            derece = ToClearText(derece);
            pictureBox1.Image = Resim(@"http://www.mgm.gov.tr/" + resim);
            string durum = @"<tbody>";
            int pos3 = html.IndexOf(durum);
            int pos4 = html.IndexOf("</tbody>", pos3);
            string ddeg = html.Substring(pos3, pos4 - pos3);
            ddeg = ToClearText(ddeg);
            string[] pars2 = ddeg.Split("".ToCharArray(), StringSplitOptions.RemoveEmptyEntries);
            string[] pars = derece.Split(" ".ToCharArray(), StringSplitOptions.RemoveEmptyEntries);
            label1.Text = gelen_Sehir;
            string dene = pars[0];
            int i = 0;
            while (dene[i] != '#')
            {
                deger += dene[i];
                i++;
            }
            if (resim == "/FILES/imgIcon/99/e_72x72t_png/-23.png")
                durum = "Çok Bulutlu";
            if (resim == "/FILES/imgIcon/99/e_72x72t_png/-29.png")
                durum = ("Güneşli");
            if (resim == "/FILES/imgIcon/99/e_36x36t_png/63.png")
                durum = ("Yağmurlu");
            if (resim == "/FILES/imgIcon/99/e_36x36t_png/-25.png")
                durum = ("Parçalı Bulutlu");
            if (resim == "/FILES/imgIcon/99/e_36x36t_png/68.png")
                durum = ("Karla Karışık Yağmurlu");
            if (resim == "/FILES/imgIcon/99/e_36x36t_png/73.png")
                durum = ("Kar Yağışlı");
            if (resim == "/FILES/imgIcon/99/e_36x36t_png/73.png")
                durum = ("Kar Yağışlı");
            if (resim == "/FILES/imgIcon/99/e_36x36t_png/82.png")
                durum = ("Kuvvetli Sağanak Yağışlı");
            if (resim == "/FILES/imgIcon/99/e_36x36t_png/75.png")
                durum = ("Yoğun Kar Yağışlı");
            if (resim == "/FILES/imgIcon/99/e_72x72t_png/45.png")
                durum = ("Sisli");
            if (resim == "/FILES/imgIcon/99/e_72x72t_png/-28.png")
                durum = ("Az Bulutlu");
            label1.Text = gelen_Sehir + " " + deger + "° C " + durum;
        }
        Bitmap Resim(string Url)
        {
            WebRequest rs = WebRequest.Create(Url);
            return (Bitmap)Bitmap.FromStream(rs.GetResponse().GetResponseStream());
        }
        private void button1_Click(object sender, EventArgs e)
        {
            HavaDurumu(textBox1.Text);
        }


    }
}

Paylaş:

C# Kur Fiyatlarını İnternet' ten Çekmek



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.Xml;



namespace Kur_Fiyatları_v2
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
        }

        private void Form1_Load(object sender, EventArgs e)
        {
            string today = "http://www.tcmb.gov.tr/kurlar/today.xml";
            var xmlDoc = new XmlDocument();
            xmlDoc.Load(today);

            // Xml içinden tarihi alma - gerekli olabilir
            DateTime exchangeDate = Convert.ToDateTime(xmlDoc.SelectSingleNode("//Tarih_Date").Attributes["Tarih"].Value);

            string USD = xmlDoc.SelectSingleNode("Tarih_Date/Currency[@Kod='USD']/BanknoteSelling").InnerXml;
            string EURO = xmlDoc.SelectSingleNode("Tarih_Date/Currency[@Kod='EUR']/BanknoteSelling").InnerXml;
            string POUND = xmlDoc.SelectSingleNode("Tarih_Date/Currency[@Kod='GBP']/BanknoteSelling").InnerXml;
            string JPY = xmlDoc.SelectSingleNode("Tarih_Date/Currency[@Kod='JPY']/BanknoteSelling").InnerXml;

            listBox1.Items.Add(string.Format("Tarih  {0}   USD/TRY       : {1}", exchangeDate.ToShortDateString(), USD));
            listBox1.Items.Add(string.Format("Tarih  {0}   EURO/TRY      : {1}", exchangeDate.ToShortDateString(), EURO));
            listBox1.Items.Add(string.Format("Tarih  {0}   POUND/TRY     : {1}", exchangeDate.ToShortDateString(), POUND));
            listBox1.Items.Add(string.Format("Tarih  {0}   JPY/TRY       : {1}", exchangeDate.ToShortDateString(), JPY));

        }
    }
}

Paylaş:

17 Kasım 2015 Salı

C# İnternet Üzerinden Yazıyı Sese Çevirme(Text To Speech) Programı Yapımı

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



        private void Form1_Load(object sender, EventArgs e)
        {
            try
            {
                webBrowser1.Navigate("https://translate.google.com.tr/");
                webBrowser1.ScriptErrorsSuppressed = true;
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
        }

        private void button1_Click(object sender, EventArgs e)
        {
            webBrowser1.Document.GetElementById("gt-src-listen").InvokeMember("click");
        }

        private void textBox1_TextChanged(object sender, EventArgs e)
        {
            webBrowser1.Document.GetElementById("source").InnerText = textBox1.Text;
        }
    }
}

Paylaş:

C# Google Haritaları Kullanmak

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

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



        private void Donustur()
        {
            textBox1.Text = textBox1.Text.Replace("ı", "i");
            textBox1.Text = textBox1.Text.Replace("ü", "u");
            textBox1.Text = textBox1.Text.Replace("ğ", "g");
            textBox1.Text = textBox1.Text.Replace("İ", "I");
            textBox1.Text = textBox1.Text.Replace("Ğ", "G");
            textBox1.Text = textBox1.Text.Replace("Ü", "U");
            textBox1.Text = textBox1.Text.Replace("Ç", "C");
            textBox1.Text = textBox1.Text.Replace("ç", "c");
            textBox1.Text = textBox1.Text.Replace("ö", "o");
            textBox1.Text = textBox1.Text.Replace("Ö", "O");
            textBox1.Text = textBox1.Text.Replace("Ş", "S");
            textBox1.Text = textBox1.Text.Replace("ş", "s");

            textBox2.Text = textBox2.Text.Replace("ı", "i");
            textBox2.Text = textBox2.Text.Replace("ü", "u");
            textBox2.Text = textBox2.Text.Replace("ğ", "g");
            textBox2.Text = textBox2.Text.Replace("İ", "I");
            textBox2.Text = textBox2.Text.Replace("Ğ", "G");
            textBox2.Text = textBox2.Text.Replace("Ü", "U");
            textBox2.Text = textBox2.Text.Replace("Ç", "C");
            textBox2.Text = textBox2.Text.Replace("ç", "c");
            textBox2.Text = textBox2.Text.Replace("ö", "o");
            textBox2.Text = textBox2.Text.Replace("Ö", "O");
            textBox2.Text = textBox2.Text.Replace("Ş", "S");
            textBox2.Text = textBox2.Text.Replace("ş", "s");

            textBox3.Text = textBox3.Text.Replace("ı", "i");
            textBox3.Text = textBox3.Text.Replace("ü", "u");
            textBox3.Text = textBox3.Text.Replace("ğ", "g");
            textBox3.Text = textBox3.Text.Replace("İ", "I");
            textBox3.Text = textBox3.Text.Replace("Ğ", "G");
            textBox3.Text = textBox3.Text.Replace("Ü", "U");
            textBox3.Text = textBox3.Text.Replace("Ç", "C");
            textBox3.Text = textBox3.Text.Replace("ç", "c");
            textBox3.Text = textBox3.Text.Replace("ö", "o");
            textBox3.Text = textBox3.Text.Replace("Ö", "O");
            textBox3.Text = textBox3.Text.Replace("Ş", "S");
            textBox3.Text = textBox3.Text.Replace("ş", "s");
        }

        private void button1_Click(object sender, EventArgs e)
        {
            Donustur();
            string sokak = textBox1.Text;
            string sehir = textBox2.Text;
            string ulke = textBox3.Text;
            string posta = textBox4.Text;
            try
            {
                StringBuilder adres = new StringBuilder();
                adres.Append("https://www.google.com/maps/place/");

                if (sokak != String.Empty)
                {
                    adres.Append(sokak + "," + "+");
                }
                if (sehir != String.Empty)
                {
                    adres.Append(sehir + "," + "+");
                }
                if (ulke != String.Empty)
                {
                    adres.Append(ulke + "," + "+");
                }
                if (posta != String.Empty)
                {
                    adres.Append(posta + "," + "+");
                }
                webBrowser1.Navigate(adres.ToString());
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message,"Hata");
            }
        }
    }
}

Paylaş:

C# Gelişmiş Hesap Makinesi Yapımı



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



        double s1, s2;
        string isaret;
        private void İslemler(object sender, EventArgs e)
        {
            Button btn = (Button)sender;
            if (btn.Text == "+")
            {
                if (s1 != 0)
                {
                    double sayi;
                    double.TryParse(textBox1.Text, out sayi);
                    textBox1.Text = (s1 + sayi).ToString();
                }
                double.TryParse(textBox1.Text, out s1);
                isaret = btn.Text;
                label1.Text =s1 + " " + isaret;
                textBox1.Text = "0";
            }
            else if (btn.Text == "-")
            {
                if (s1 != 0)
                {
                    double sayi;
                    double.TryParse(textBox1.Text, out sayi);
                    textBox1.Text = (s1 - sayi).ToString();
                }
                double.TryParse(textBox1.Text, out s1);
                isaret = btn.Text;
                label1.Text = s1 + " " + isaret;
                textBox1.Text = "0";
            }
            else if (btn.Text == "/")
            {
                if (s1 != 0)
                {
                    double sayi;
                    double.TryParse(textBox1.Text, out sayi);
                    if (sayi == 0) label1.Text = "Hata"; else textBox1.Text = (s1 / sayi).ToString();
                }
                double.TryParse(textBox1.Text, out s1);
                isaret = btn.Text;
                label1.Text = s1 + " " + isaret;
                textBox1.Text = "0";
            }
            else if (btn.Text == "*")
            {
                if (s1 != 0)
                {
                    double sayi;
                    double.TryParse(textBox1.Text, out sayi);
                    textBox1.Text = (s1 * sayi).ToString();
                }
                double.TryParse(textBox1.Text, out s1);
                isaret = btn.Text;
                label1.Text = s1 + " " + isaret;
                textBox1.Text = "0";
            }
            else if (btn.Text == "%")
            {
                if (s1 != 0)
                {
                    double sayi;
                    double.TryParse(textBox1.Text, out sayi);
                    if (sayi == 0) label1.Text = "Hata"; else textBox1.Text = (s1 % sayi).ToString();
                }
                double.TryParse(textBox1.Text, out s1);
                isaret = btn.Text;
                label1.Text = s1 + " " + isaret;
                textBox1.Text = "0";
            }
            else if (btn.Text == "n!")
            {
                double sayi;
                double fakt=1;
                double.TryParse(textBox1.Text, out sayi);
                try
                {
                    for (int i = 1; i <= sayi; i++)
                    {
                        fakt = fakt * i;
                    }
                    if (fakt.ToString() == "Infinity")
                    {
                        label1.Text = "Hata"; textBox1.Text = "0";
                    }
                    else
                    {
                        textBox1.Text = fakt.ToString();
                        label1.Text = sayi + "!";
                    }
                }
                catch (Exception ex)
                {
                    label1.Text = ex.Message;
                    textBox1.Text = "0";
                }
            }
            else if (btn.Text == "√")
            {
                double.TryParse(textBox1.Text, out s1);
                textBox1.Text = Math.Sqrt(s1).ToString();
                label1.Text = "√" + s1;
            }
            else if (btn.Text == "³√")
            {
                double.TryParse(textBox1.Text, out s1);
                textBox1.Text = Math.Pow(s1, (double)1 / 3).ToString();//Math.Pow(s1, 0.333333333333333).ToString();//0.333333333333333 sayısı 1/3 ün sonucudur...
                label1.Text = "³√" + s1;
            }
            else if (btn.Text == "PI")
            {
                double.TryParse(textBox1.Text, out s1);
                textBox1.Text = Math.PI.ToString();
                label1.Text = "PI";
            }
            else if (btn.Text == "Sin")
            {
                double.TryParse(textBox1.Text, out s1);
                textBox1.Text = Math.Sin(Math.PI * s1 / 180).ToString();
                label1.Text = "Sin " + s1;
            }
            else if (btn.Text == "Cos")
            {
                double.TryParse(textBox1.Text, out s1);
                textBox1.Text = Math.Cos(Math.PI * s1 / 180).ToString();
                label1.Text = "Cos " + s1;
            }
            else if (btn.Text == "Tan")
            {
                double.TryParse(textBox1.Text, out s1);
                textBox1.Text = Math.Tan(Math.PI * s1 / 180).ToString();
                label1.Text = "Tan " + s1;
            }
            else if (btn.Text == "x²")
            {
                double.TryParse(textBox1.Text, out s1);
                textBox1.Text = (s1 * s1).ToString();
                label1.Text = s1 + "²";
            }
            else if (btn.Text == "x³")
            {
                double.TryParse(textBox1.Text, out s1);
                textBox1.Text = (s1 * s1 * s1).ToString();
                label1.Text = s1 + "³";
            }
            else if (btn.Text == "Üs")
            {
                double.TryParse(textBox1.Text, out s1);
                isaret = btn.Text;
                label1.Text = s1 + "^";
                textBox1.Text = "0";
            }
            else if (btn.Text == "ln")
            {
                double.TryParse(textBox1.Text, out s1);
                textBox1.Text = Math.Log(s1).ToString();
                label1.Text = "ln " + s1;
            }
            else if (btn.Text == "Log10")
            {
                double.TryParse(textBox1.Text, out s1);
                textBox1.Text = Math.Log10(s1).ToString();
                label1.Text = "Log10 " + s1;
            }
            else if (btn.Text == "Log(sy,tbn)")
            {
                double.TryParse(textBox1.Text, out s1);
                isaret = btn.Text;
                label1.Text = "Log(" + s1 + ",taban)";
                textBox1.Text = "0";
            }
            else if (btn.Text == "1/x")
            {
                double.TryParse(textBox1.Text, out s1);
                label1.Text = "1/" + s1;
                if (s1 != 0) textBox1.Text = (1 / s1).ToString(); else label1.Text = "Hata";
            }
            else if (btn.Text == "e")
            {
                double.TryParse(textBox1.Text, out s1);
                textBox1.Text = Math.E.ToString();
            }
            else if (btn.Text == "C")
            {
                s1 = 0;
                s2 = 0;
                isaret = "";
                textBox1.Text = "0";
                label1.Text = "";
            }
            else if (btn.Text == "<-")
            {
                try
                {
                    if (textBox1.Text.Length != 0)
                    {
                        textBox1.Text = textBox1.Text.Substring(0, textBox1.Text.Length - 1);
                        if (textBox1.Text.Length == 0)
                        {
                            textBox1.Text = "0";
                        }
                    }
                }
                catch
                { }
            }
            if (btn.Text == "=")
            {
                label1.Text = "";
                double.TryParse(textBox1.Text, out s2);
                if (isaret == "+") textBox1.Text = (s1 + s2).ToString();
                if (isaret == "-") textBox1.Text = (s1 - s2).ToString();
                if (isaret == "*") textBox1.Text = (s1 * s2).ToString();
                if (isaret == "/") if (s2 == 0) label1.Text = "Hata"; else textBox1.Text = (s1 / s2).ToString();
                if (isaret == "%") if (s2 == 0) label1.Text = "Hata"; else textBox1.Text = (s1 % s2).ToString();
                if (isaret == "Üs") textBox1.Text = Math.Pow(s1, s2).ToString();
                if (isaret == "Log(sy,tbn)") textBox1.Text = Math.Log(s1, s2).ToString();
            }
        }

        private void Rakamlar(object sender, EventArgs e)
        {
            Button btn = (Button)sender;
            if (textBox1.Text != "0")
            {
                textBox1.Text += btn.Text;
            }
            else
            {
                textBox1.Clear();
                textBox1.Text += btn.Text;
            }
        }

        private void button31_Click(object sender, EventArgs e)
        {
            if (textBox1.Text.Contains(",")) return;
            textBox1.Text += ",";
        }

        private void standartToolStripMenuItem_Click(object sender, EventArgs e)
        {
            this.Size = new System.Drawing.Size(286, 430);
        }

        private void gelişmişToolStripMenuItem_Click(object sender, EventArgs e)
        {
            this.Size = new System.Drawing.Size(515, 430);
        }

        private void hakkımdaToolStripMenuItem_Click(object sender, EventArgs e)
        {
            MessageBox.Show("Görsel Programlama Ödevi\nTasarlayan: Fikri KOCAOĞLAN","Hakkında",MessageBoxButtons.OK,MessageBoxIcon.Information);
        }


    }
}

Paylaş:

15 Kasım 2015 Pazar

C# Türkçe - İngilizce Sözlük Yapımı




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

namespace Sözlük
{
    public partial class Form1 : Form
    {


        public Form1()
        {
            InitializeComponent();
        }
        private void Form1_Load(object sender, EventArgs e)
        {

            try
            {
                webBrowser1.Navigate("https://translate.google.com.tr/#tr/en/");
                webBrowser1.ScriptErrorsSuppressed = true;
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
        }

        private void textBox1_TextChanged(object sender, EventArgs e)
        {
            webBrowser1.Document.GetElementById("source").InnerText = textBox1.Text;
            timer1.Start();
        }

        private void button1_Click(object sender, EventArgs e)
        {
            try
            {
                webBrowser1.Document.GetElementById("gt-swap").InvokeMember("click");
                if (label1.Text == "Türkçe")
                {
                    label1.Text = "İngilizce";
                    label2.Text = "Türkçe";
                }
                else if (label1.Text == "İngilizce")
                {
                    label1.Text = "Türkçe";
                    label2.Text = "İngilizce";
                }
                webBrowser1.Document.GetElementById("source").InnerText = textBox1.Text;
            }
            catch
            { }
        }

        private void timer1_Tick(object sender, EventArgs e)
        {
            try
            {
                textBox2.Text = webBrowser1.Document.GetElementById("result_box").InnerText;
            }
            catch
            { }
        }

        private void button3_Click(object sender, EventArgs e)
        {
            try
            {
                webBrowser1.Document.GetElementById("gt-src-roman").InvokeMember("click");
            }
            catch
            { }
        }

        private void button2_Click(object sender, EventArgs e)
        {
            try
            {
                webBrowser1.Document.GetElementById("gt-src-listen").InvokeMember("click");
            }
            catch
            { }
        }

        private void button3_Click_1(object sender, EventArgs e)
        {
            try
            {
                webBrowser1.Document.GetElementById("gt-res-listen").InvokeMember("click");
            }
            catch
            { }
        }
    }
}


Paylaş:

14 Kasım 2015 Cumartesi

27 Ekim 2015 Salı

C# Hesap Makinesi Yapımı





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

        private void butonlar_Click(object sender, EventArgs e)
        {
            Button btn = (Button)sender;
            textBox1.Text += btn.Text;
         //Rakamların olduğu Butonları Tek Tek Seçip Click Eventini Açıyoruz..
        }

        private void button11_Click(object sender, EventArgs e)
        {
            textBox1.Clear();
        }

        private void button12_Click(object sender, EventArgs e)
        {
            try
            {
                if (textBox1.Text.Length != 0)
                {
                    textBox1.Text = textBox1.Text.Substring(0, textBox1.Text.Length - 1);
                }
            }
            catch
            { }
        }
        double s1,s2;
        string isaret;
        private void oprtrButon_Click(object sender, EventArgs e)
        {
            //+,-,*,/,= ve % olan Butonları Tek Tek Seçip Click Eventini Açıyoruz..
            Button btn = (Button)sender;
            if (btn.Text == "+")
            {
                double.TryParse(textBox1.Text, out s1);
                isaret = btn.Text;
                textBox1.Clear();

            }
            else if (btn.Text == "-")
            {
                double.TryParse(textBox1.Text, out s1);
                isaret = btn.Text;
                textBox1.Clear();

            }
            else if (btn.Text == "/")
            {
                double.TryParse(textBox1.Text, out s1);
                isaret = btn.Text;
                textBox1.Clear();

            }
            else if (btn.Text == "*")
            {
                double.TryParse(textBox1.Text, out s1);
                isaret = btn.Text;
                textBox1.Clear();

            }
            else if (btn.Text == "%")
            {
                double.TryParse(textBox1.Text, out s1);
                isaret = btn.Text;
                textBox1.Clear();

            }
            if (btn.Text == "=")
            {
                double.TryParse(textBox1.Text, out s2);
                if (isaret == "+") textBox1.Text = (s1 + s2).ToString();
                if (isaret == "-") textBox1.Text = (s1 - s2).ToString();
                if (isaret == "*") textBox1.Text = (s1 * s2).ToString();
                if (isaret == "/") textBox1.Text = (s1 / s2).ToString();
                if (isaret == "%") textBox1.Text = (s1 % s2).ToString();
            }
        }

    }
}

Paylaş:

16 Ekim 2015 Cuma

15 Ekim 2015 Perşembe

C# İle Basit Paint Uygulaması



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



        string çizim = "Çizgi";//Radio Butonlar Çizgi,Dikdörtgen,Elips,Serbest
        private void arac_sec_CheckedChanged_1(object sender, EventArgs e)//4 RadioButonu da Seçip CheckedChanged eventine kodu yazıyoruz.
        {
            RadioButton rb = (RadioButton)sender;
            if (rb.Checked)
            {
                çizim = rb.Text;
            }
        }
        Point p1, p2;

        private void Form1_MouseMove(object sender, MouseEventArgs e)
        {
            if (e.Button == MouseButtons.Left)
            {
                if (çizim == "Serbest")
                {
                    Graphics g = this.CreateGraphics();
                    Pen kalem = new Pen(Color.Red, 4);
                    Point pt1 = new Point(e.X, e.Y);
                    Point pt2 = new Point(e.X + 1, e.Y + 1);

                    g.DrawLine(kalem, pt1, pt2);
                }
            }
        }

        private void Form1_MouseDown(object sender, MouseEventArgs e)
        {
            p1 = new Point(e.X, e.Y);
        }

        private void Form1_MouseUp(object sender, MouseEventArgs e)
        {
            p2 = new Point(e.X, e.Y);

            Graphics g = this.CreateGraphics();
            Pen kalem = new Pen(Color.Red, 2);
            Rectangle dortgen = new Rectangle(p1.X, p1.Y, p2.X - p1.X, p2.Y - p1.Y);
            SolidBrush fırça = new SolidBrush(Color.Yellow);

            if (çizim == "Çizgi")
                g.DrawLine(kalem, p1, p2);
            else if (çizim == "Dikdörtgen")
            {
                if (Tara.Checked)
                    g.FillRectangle(fırça, dortgen);
                g.DrawRectangle(kalem, dortgen);
            }
            else if (çizim == "Elips")
            {
                if (Tara.Checked)
                    g.FillEllipse(fırça, dortgen);
                g.DrawEllipse(kalem, dortgen);
            }
        }
    }
}

Paylaş:

PHP POST Yöntemiyle Veri Gönderme

form_post.php Sayfası

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Form_Post</title>
</head>

<body>
<form id="form1" action="post_isle.php" method="POST">
<table width="480" style="background-color:#c9d2a2;">
<tr><td colspan="2" style="background-color:#bdbddf;">Üye Kayıt Formu</td></tr>
<tr><td width="120">Adınız:</td><td><input type="text" name="txtAd" size="24" value="" /></td></tr>
<tr><td width="120">E-Posta:</td><td><input type="text" name="txtEPosta" size="40" value="@" /></td></tr>
<tr><td width="120">Parolanız:</td><td><input type="password" name="txtParola" size="10" value="" /></td></tr>
<tr><td width="120">Adınız:</td><td><input type="submit" value="Gönder" /><input type="reset" value="Temizle" /></td></tr>
</table>
</form>
</body>
</html>


post_isle.php Sayfası

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Post_İsle</title>
</head>
<body>
<?php
if(isset($_POST["txtAd"]))$ad = $_POST["txtAd"];
if(isset($_POST["txtEPosta"]))$eposta = $_POST["txtEPosta"];
if(isset($_POST["txtParola"]))$parola = $_POST["txtParola"];
echo "Formdan <b>POST</b> Methoduyla Gelen Veriler <br>";
echo "<br>Ad:".$ad;
echo "<br>E-Posta:".$eposta;
echo "<br>Parola:".$parola;
?>
</body>
</html>
Paylaş:

PHP GET Yöntemiyle Veri Gönderme

form_get.php Sayfası

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>

<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Form_Get</title>
</head>
<body>
<form id="form1" action="get_isle.php" method="get">
<table width="480" style="background-color:#c9d2a2;">
<tr><td colspan="2" style="background-color:#bdbddf;">Üye Kayıt Formu</td></tr>
<tr><td width="120">Adınız:</td><td><input type="text" name="txtAd" size="24" value="" /></td></tr>
<tr><td width="120">E-Posta:</td><td><input type="text" name="txtEPosta" size="40" value="@" /></td></tr>
<tr><td width="120">Parolanız:</td><td><input type="password" name="txtParola" size="10" value="" /></td></tr>
<tr><td width="120">Adınız:</td><td><input type="submit" value="Gönder" /><input type="reset" value="Temizle" /></td></tr>
</table>
</form>
</body>
</html>

get_isle.php Sayfası

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Get_İsle</title>
</head>
<body>
<?php
if(isset($_GET["txtAd"]))$ad = $_GET["txtAd"];
if(isset($_GET["txtEPosta"]))$eposta = $_GET["txtEPosta"];
if(isset($_GET["txtParola"]))$parola = $_GET["txtParola"];
echo "Formdan <b>GET</b> Methoduyla Gelen Veriler <br>";
echo "<br>Ad:".$ad;
echo "<br>E-Posta:".$eposta;
echo "<br>Parola:".$parola;
?>
</body>
</html>
Paylaş:

13 Ekim 2015 Salı

PHP ile Vize Final Not Hesabı

<form action="nothesaplama.php" method="get">
<div>Vize:<input type="text" name="txtVize" value="" /></div>
<div>Final:<input type="text" name="txtFinal" value="" /></div>
<div><input type="submit" value="Hesapla" /></div>
</form>

<?php
@$vize=$_GET["txtVize"];
@$final=$_GET["txtFinal"];
echo "Vize= $vize";
echo "<br>Final= $final";
$ortalama = ($vize * 0.4) + ($final * 0.6);
echo "<br>Ortalama= $ortalama";
if($ortalama >= 60 && $final >= 50)
{
echo "<br>GEÇTİ";
}
else
{
echo "<br>KALDI";
}

if($ortalama>=90 &&$ortalama<=100) $bn="AA";
if($ortalama>=85 &&$ortalama<90) $bn="BA";
if($ortalama>=80 &&$ortalama<85) $bn="BB";
if($ortalama>=75 &&$ortalama<80) $bn="CB";
if($ortalama>=65 &&$ortalama<75) $bn="CC";
if($ortalama>=58 &&$ortalama<65) $bn="DC";
if($ortalama>=50 &&$ortalama<58) $bn="DD";
if($ortalama>=0 &&$ortalama<50) $bn="FF";
switch($bn)
{
case "AA":$ks=4.0; break;
case "BA":$ks=3.5; break;
case "BB":$ks=3.0; break;
case "CB":$ks=2.5; break;
case "CC":$ks=2.0; break;
case "DC":$ks=1.5; break;
case "DD":$ks=1.0; break;
case "FF":$ks=0.0; break;
}
echo "<br>Harf Notu= $bn<br>Kat Sayısı= $ks";
?>
Paylaş:

11 Ekim 2015 Pazar

C# Müzik Çalar Yapımı



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.Runtime.InteropServices;
using System.IO;



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

        private void Form1_Load(object sender, EventArgs e)
        {
            try
            {
                String[] degerler = new String[] { };
                degerler = (File.ReadAllLines("D:\\ParcaListesi.txt"));
                for (int j = 0; j <= degerler.Length; j++)
                {
                    listBox1.Items.Add(degerler.GetValue(j));
                }
            }
            catch
            {
            }
            try
            {
                sahip1.Text = " Copyright Fikri KOCAOGLAN™";
                bilgilabel1.Text = "Listede Toplam " + listBox1.Items.Count + " Tane Parça Var.";
                listBox1.SetSelected(i, true);
            }
            catch
            { }
        }
        Random rnd = new Random();
        private void muzikcal()
        {
            try
            {
                if (listBox1.Items.Count != 0)
                {
                    if (radioButton1.Checked==true)
                    {
                        axWindowsMediaPlayer1.URL = listBox1.SelectedItem.ToString();
                        i++;
                        listBox1.SetSelected(i, true);
                    }
                    else if (radioButton2.Checked == true)
                    {
                        axWindowsMediaPlayer1.URL = listBox1.SelectedItem.ToString();
                        listBox1.SetSelected(rnd.Next(0, listBox1.Items.Count), true);
                    }
                }
                else
                {
                    MessageBox.Show("Önce Listeye Müzik Eklemelisiniz!", "Bilgi", MessageBoxButtons.OK, MessageBoxIcon.Information);

                }
            }
            catch
            {

            }
        }

        private void button2_Click(object sender, EventArgs e)
        {
         
            muzikcal();
            if (checkBox1.Checked)
            {
                if (listBox1.Items.Count != 0)
                {
                    timer1.Enabled = true;
                }
            }
        }

        private void button1_Click(object sender, EventArgs e)
        {
                folderBrowserDialog1.ShowDialog();
                string yol = folderBrowserDialog1.SelectedPath;

                listBox1.Items.Clear();
                try
                {
                    foreach (string bulunandosya in Directory.GetFiles
                        (yol, "*.mp3", SearchOption.TopDirectoryOnly))
                        listBox1.Items.Add(bulunandosya);
                    listBox1.SetSelected(i, true);
                }
                catch
                {
                try
                {
                    foreach (string bulunandosya in Directory.GetFiles
                       (yol, "*.mp4", SearchOption.TopDirectoryOnly))
                        listBox1.Items.Add(bulunandosya);
                    listBox1.SetSelected(i, true);
                }
                catch
                {
                try
                {
                    foreach (string bulunandosya in Directory.GetFiles
                       (yol, "*.wav", SearchOption.TopDirectoryOnly))
                        listBox1.Items.Add(bulunandosya);
                    listBox1.SetSelected(i, true);
                }
                catch
                {
                try
                {
                    foreach (string bulunandosya in Directory.GetFiles
                       (yol, "*.avi", SearchOption.TopDirectoryOnly))
                        listBox1.Items.Add(bulunandosya);
                    listBox1.SetSelected(i, true);
                }
                catch
                {
                    MessageBox.Show("Herhangi bir Media Dosyası Bulunamadı!!!", "Bilgi", MessageBoxButtons.OK, MessageBoxIcon.Information);
                }
                }
                }
                }
                bilgilabel1.Text = "Listede Toplam " + listBox1.Items.Count + " Tane Parça Listeye Eklendi.";
         
        }
        int i = 0;
        private void button3_Click(object sender, EventArgs e)
        {
            try
            {
                if (listBox1.Items.Count != 0)
                {
                    if (radioButton1.Checked == true && checkBox1.Checked == false)
                    {
                        if (i > 0)
                        {
                            i--;
                            listBox1.SetSelected(i, true);
                            axWindowsMediaPlayer1.URL = listBox1.SelectedItem.ToString();
                        }
                        else
                        {
                            i = listBox1.Items.Count - 1;
                            listBox1.SetSelected(i, true);
                            axWindowsMediaPlayer1.URL = listBox1.SelectedItem.ToString();
                        }
                    }
                    else if (radioButton1.Checked == true && checkBox1.Checked == true)
                    {
                        if (i > 0)
                        {
                            timer1.Enabled = false;
                            i--;
                            listBox1.SetSelected(i, true);
                            axWindowsMediaPlayer1.URL = listBox1.SelectedItem.ToString();
                            timer1.Enabled = true;
                        }
                        else
                        {
                            timer1.Enabled = false;
                            i = listBox1.Items.Count - 1;
                            listBox1.SetSelected(i, true);
                            axWindowsMediaPlayer1.URL = listBox1.SelectedItem.ToString();
                            timer1.Enabled = true;
                        }
                    }
                    else
                    {
                        axWindowsMediaPlayer1.URL = listBox1.SelectedItem.ToString();
                        listBox1.SetSelected(rnd.Next(0, listBox1.Items.Count), true);
                    }

                }
                else
                {
                    MessageBox.Show("Önce Listeye Müzik Eklemelisiniz!", "Bilgi", MessageBoxButtons.OK, MessageBoxIcon.Information);

                }
            }
            catch
            {

            }
        }

        private void button4_Click(object sender, EventArgs e)
        {
            try
            {
                if (listBox1.Items.Count != 0)
                {
                    if (radioButton1.Checked == true && checkBox1.Checked == false)
                    {
                        if (i < listBox1.Items.Count - 1)
                        {
                            sayac++;
                            i++;
                            listBox1.SetSelected(i, true);
                            axWindowsMediaPlayer1.URL = listBox1.SelectedItem.ToString();
                        }
                        else if (i == listBox1.Items.Count - 1)
                        {
                            i = 0;
                            listBox1.SetSelected(i, true);
                            axWindowsMediaPlayer1.URL = listBox1.SelectedItem.ToString();
                        }
                    }
                    else if (radioButton1.Checked == true && checkBox1.Checked == true)
                    {
                        if (i < listBox1.Items.Count - 1)
                        {
                            timer1.Enabled = false;
                            i++;
                            listBox1.SetSelected(i, true);
                            axWindowsMediaPlayer1.URL = listBox1.SelectedItem.ToString();
                            timer1.Enabled = true;
                        }
                        else if (i == listBox1.Items.Count - 1)
                        {
                            timer1.Enabled = false;
                            i = 0;
                            listBox1.SetSelected(i, true);
                            axWindowsMediaPlayer1.URL = listBox1.SelectedItem.ToString();
                            timer1.Enabled = true;
                        }
                    }
                    else
                    {
                        axWindowsMediaPlayer1.URL = listBox1.SelectedItem.ToString();
                        listBox1.SetSelected(rnd.Next(0, listBox1.Items.Count), true);
                    }
                    if (radioButton1.Checked)
                    {
                        if (sayac == listBox1.Items.Count - 1)
                        {
                            timer1.Enabled = false;
                            MessageBox.Show("Tüm Müzikler Çalındı!", "BİLGİ", MessageBoxButtons.OK, MessageBoxIcon.Information);
                        }
                    }
                }
                else
                {
                    MessageBox.Show("Önce Listeye Müzik Eklemelisiniz!", "Bilgi", MessageBoxButtons.OK, MessageBoxIcon.Information);

                }
            }
            catch
            {

            }
        }
        int sayac = 0;
        private void timer1_Tick(object sender, EventArgs e)
        {
            string kalanSure = axWindowsMediaPlayer1.Ctlcontrols.currentPositionString.ToString();
            string maxSure =  axWindowsMediaPlayer1.Ctlcontrols.currentItem.durationString;
            int maxx = Convert.ToInt32(axWindowsMediaPlayer1.Ctlcontrols.currentPosition);
            int kalann = Convert.ToInt32(axWindowsMediaPlayer1.Ctlcontrols.currentItem.duration);
            if (kalann == maxx)
            {
                sayac++;
                muzikcal();
            }
            if (radioButton1.Checked)
            {
                if (sayac == listBox1.Items.Count - 1)
                {
                    timer1.Enabled = false;
                    MessageBox.Show("Tüm Müzikler Çalındı!", "BİLGİ", MessageBoxButtons.OK, MessageBoxIcon.Information);
                }
            }
         
        }

        private void checkBox1_CheckedChanged(object sender, EventArgs e)
        {
            if (checkBox1.Checked == true)
                timer1.Enabled = true;
            else
                timer1.Enabled = false;
        }

        private void button5_Click(object sender, EventArgs e)
        {
            axWindowsMediaPlayer1.Ctlcontrols.stop();
        }

        private void button6_Click(object sender, EventArgs e)
        {
            if (listBox1.Items.Count != 0)
            {
                FileStream fs = new FileStream("D:\\ParcaListesi.txt",
                    FileMode.Create, FileAccess.Write, FileShare.Write);
                StreamWriter sw = new StreamWriter(fs);
                for (int i = 0; i <= listBox1.Items.Count - 1; i++)
                    sw.WriteLine(listBox1.Items[i]);
                sw.Close();
                MessageBox.Show("Liste Kaydedildi!", "BİLGİ", MessageBoxButtons.OK, MessageBoxIcon.Information);
                bilgilabel1.Text = "Listeye Toplam " + listBox1.Items.Count + " Tane Parça Eklendi.";

            }
            else
            {
                MessageBox.Show("Liste Boş!", "BİLGİ", MessageBoxButtons.OK, MessageBoxIcon.Information);

            }
        }

        private void button7_Click(object sender, EventArgs e)
        {
            try
            {
                if (MessageBox.Show("Listeyi Silmek İstiyormusunuz?", "BİLGİ", MessageBoxButtons.YesNoCancel, MessageBoxIcon.Question)==DialogResult.Yes)
                {
                    File.Delete("D:\\ParcaListesi.txt");
                    MessageBox.Show("Liste Silindi!", "BİLGİ", MessageBoxButtons.OK, MessageBoxIcon.Information);
                    listBox1.Items.Clear();
                    bilgilabel1.Text = "Listede Toplam " + listBox1.Items.Count + " Tane Parça Var.";

                }
                else
                {
                    MessageBox.Show("Liste Silme İşlemi İptal Edildi!", "BİLGİ", MessageBoxButtons.OK, MessageBoxIcon.Information);

                }
            }
            catch (Exception ex)
            { }
        }

        private void timer2_Tick(object sender, EventArgs e)
        {
            try
            {
                sahip1.Text = sahip1.Text.Substring(1) + sahip1.Text.Substring(0, 1);
            }
            catch
            { }
        }
    }
}


Paylaş:

Popüler

Son

Kategoriler