C# Dosya Taşıma Form Application








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

        private void Form1_Load(object sender, EventArgs e)
        {

        }

        private void button1_Click(object sender, EventArgs e)
        {
            if (textBox1.Text == "")
            {
                MessageBox.Show("DOsya adı giriniz");
            }
            else {
                Directory.CreateDirectory("KLASÖR EKLEYECEĞİN YER"+textBox1.Text);
                MessageBox.Show("Oluşturma Başarılı");
            }
        }

        private void label4_Click(object sender, EventArgs e)
        {

        }

        private void button4_Click(object sender, EventArgs e)
        {
            if (textBox4.Text == "")
            {
                MessageBox.Show("DOsya adı giriniz");
            }
            else
            {
                Directory.Delete(@"KLASÖRÜ SİLECEĞİN YER" + textBox4.Text);
                MessageBox.Show("silme Bşarılı");
            }
        }
        string tasinacak_dosya = "", tasinacakDosyaAdi = "", tasinacak_yer = "";

        private void button5_Click(object sender, EventArgs e)
        {
            File.Move(tasinacak_dosya, tasinacak_yer + "\\" + tasinacakDosyaAdi);
            MessageBox.Show("Dosya Taşıma İşlemi Başarılı", "Dosya Taşındı...");
        }

        private void button3_Click(object sender, EventArgs e)
        {
            if (folderBrowserDialog1.ShowDialog() == DialogResult.OK)
            {
                tasinacak_yer = folderBrowserDialog1.SelectedPath.ToString();
                textBox3.Text = tasinacak_yer;
            }
            else {
                MessageBox.Show("Tasinacak yeri seçmediniz");
            }
        }

        private void button2_Click(object sender, EventArgs e)
        {
            openFileDialog1.Title="dosya seçin";
            openFileDialog1.FileName = "";
            if (openFileDialog1.ShowDialog() == DialogResult.OK)
            {
                tasinacakDosyaAdi = openFileDialog1.SafeFileName.ToString();
                tasinacak_dosya = openFileDialog1.FileName.ToString();
                textBox2.Text = tasinacak_dosya;

            }
            else {
                MessageBox.Show("Dosya seçmediniz Lütfen dosya seçin");
            }
        }
    }
}


Yorumlar

Bu blogdaki popüler yayınlar

SQL Group By Kullanımı

C# Armstrong sayı bulma.