Esempio n. 1
0
        private void YedekYukle_Load(object sender, EventArgs e)
        {
            try
            {
                tarih.Text = fk.SonYedekYukleme();
                if (tarih.Text == "")
                {
                    tarih.Text = "Yedek yüklenmemiştir.";
                }
            }
            catch (Exception ed1)
            {
                MessageBox.Show(ed1.Message, "Hata", MessageBoxButtons.OK, MessageBoxIcon.Information);
            }
            try
            {
                FbConnection baglan = new FbConnection(fk.Baglanti_Kodu());
                baglan.Open();
                FbCommand    Cek = new FbCommand("select yedek_dizin from Ayar", baglan);
                FbDataReader oku = Cek.ExecuteReader();
                oku.Read();
                string path = oku["yedek_dizin"].ToString();
                baglan.Close();
                if (path == "" || path == "0")
                {
                    path = Application.StartupPath.ToString();
                }

                DirectoryInfo   Yillar = new DirectoryInfo(path + "\\");
                DirectoryInfo[] Dos    = Yillar.GetDirectories();

                if (Dos.Length > 0)
                {
                    foreach (DirectoryInfo yaz in Dos)
                    {
                        yil.Items.Add(yaz.Name);
                    }
                    yil.SelectedIndex = 0;
                }
                else
                {
                    MessageBox.Show("Yedek dosyanız bulunmamaktadır.", "Yedekleme Bilgilendirme", MessageBoxButtons.OK, MessageBoxIcon.Information);
                }
            }
            catch (Exception ee)
            {
                MessageBox.Show(ee.Message, "Hata oluştu", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }