C# MP3 ID3 Görüntüleyici/Değiştirici

Kruvazör

Yazılım Ekibi Lideri
28 Mar 2020
1,724
2,542
Wrong Side Of Heaven
Herkese merhaba arkadaşlar ben kruvazör.
Bugün sizlerle kısaca mp3 dosyalarındaki ID3 taglarını ne işe yaradıklarını konuşacağız ve ardından bu tagları görüntülemek ve değiştirmek için basit bir
c# uygulaması yapacağız.


mp3 tagları
buradan tüm taglara ulaşabilirsiniz.

MP3 ID3 tagleri, MP3 dosyalarındaki içerik hakkında bilgi barındırmak için kullanılan yapılardır. Bu yapı, şarkının adı, sanatçı, albüm ismi, çıkış yılı, bpm ve daha birçok bilgi içerebilir.

Kısaca müzik için detay bilgileri içeren tagler diyebiliriz.

Örneğimize geçelim.

13 textbox
12 label
2 button
1 groupbox

7orjriq.jpg


Üst menüden nuget paketlerine gelelim
licjd3v.jpg


eodfume.jpg


Bu paketi indirdikten sonra kodlarımızı yazmaya başlayabiliriz.



dosya seç buttonuna gelelim ve kodlarımızı ekleyelim

C#:
   private void button1_Click(object sender, EventArgs e)
   {
       using (OpenFileDialog openFileDialog = new OpenFileDialog())  //kullanıcıya filedialog göstererek müzik dosyasını seçmesini sağlıyoruz.
       {
           openFileDialog.Filter = "MP3 Files|*.mp3";
           openFileDialog.Title = "MP3 harici dosya valla kabul etmem";

           if (openFileDialog.ShowDialog() == DialogResult.OK)
           {
               textBox1.Text = openFileDialog.FileName;
               LoadMP3Tags();
           }
       }
   }

LoadMP3Tags isimli bir fonksiyon oluşturalım ve kodlarımızı yazalım
C#:
        private void LoadMP3Tags()
        {
            string mp3FilePath = textBox1.Text;

            // Dosya yolu boş ise işlemi sonlandır
            if (string.IsNullOrEmpty(mp3FilePath))
                return;

            try
            {
            
                var file = TagLib.File.Create(mp3FilePath);

                // Tagleri textboxlara atıyorum
                textBox2.Text = file.Tag.Title;
                textBox3.Text = file.Tag.Album;
                textBox4.Text = file.Tag.Performers.Length > 0 ? file.Tag.Performers[0] : "";
                textBox5.Text = file.Tag.AlbumArtists.Length > 0 ? file.Tag.AlbumArtists[0] : "";
                textBox6.Text = file.Tag.Composers.Length > 0 ? file.Tag.Composers[0] : "";
                textBox7.Text = file.Tag.Genres.Length > 0 ? file.Tag.Genres[0] : "";
                textBox8.Text = file.Tag.Year.ToString();
                textBox9.Text = file.Tag.Comment;
                textBox10.Text= file.Tag.BeatsPerMinute.ToString();
                textBox13.Text = file.Tag.Lyrics;
               
             
            }
            catch (Exception ex)
            {
                MessageBox.Show($"Hata: {ex.Message}", "Hata", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }

Uygula isimli buttona gelelim ve son kez buraya da kodlarımızı yazalım
C#:
 private void button2_Click(object sender, EventArgs e)
 {
     // MP3 dosyasının yolunu al
     string mp3FilePath = textBox1.Text;

     if (string.IsNullOrEmpty(mp3FilePath))
     {
         MessageBox.Show("Lütfen bir MP3 dosyası seçin.", "Hata", MessageBoxButtons.OK, MessageBoxIcon.Error);
         return;
     }

     try
     {
         // TagLib# kullanarak MP3 dosyasının tag şeysilerine bakma
         var file = TagLib.File.Create(mp3FilePath);

         file.RemoveTags(TagTypes.AllTags);

          //yukardai gibi aldım verdim yabıyoz işte yormayın beni yorum satırı felan
         var tag = file.GetTag(TagTypes.Id3v2, true);
         tag.Title = textBox2.Text;
         tag.Album = textBox3.Text;
         tag.Performers = new[] { textBox4.Text };
         tag.AlbumArtists = new[] { textBox5.Text };
         tag.Composers = new[] { textBox6.Text };
         tag.Genres = new[] { textBox7.Text };
         tag.Year = (uint)int.Parse(textBox8.Text);
         tag.Comment = textBox9.Text;
         tag.BeatsPerMinute = ((uint) int.Parse(textBox10.Text));
         tag.Lyrics = textBox13.Text;

       



         // Değişiklikleri kaydet
         file.Save();

         MessageBox.Show("Tag'ler başarıyla güncellendi.", "Bilgi", MessageBoxButtons.OK, MessageBoxIcon.Information);
     }
     catch (Exception ex)
     {
         MessageBox.Show($"Hata: {ex.Message}", "Hata", MessageBoxButtons.OK, MessageBoxIcon.Error);
     }
 }


TEST
sdo9rsn.jpg

s21ik4r.jpg



Gördüğümüz üzere verileri güzel bir biçimde yazıyor ve okuyor.





KODLARIN TAMAMI:
C#:
using System;
[COLOR=rgb(255, 255, 255)][SIZE=5]using System.Windows.Forms;
using TagLib;
namespace Mp3_MetaMaker
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
        }

        private void button1_Click(object sender, EventArgs e)
        {
            using (OpenFileDialog openFileDialog = new OpenFileDialog())
            {
                openFileDialog.Filter = "MP3 Files|*.mp3";
                openFileDialog.Title = "MP3 harici dosya valla kabul etmem";

                if (openFileDialog.ShowDialog() == DialogResult.OK)
                {
                    textBox1.Text = openFileDialog.FileName;

                    
                    LoadMP3Tags();
                }
            }
        }

        private void LoadMP3Tags()
        {
            string mp3FilePath = textBox1.Text;

    
            if (string.IsNullOrEmpty(mp3FilePath))
                return;

            try
            {
               
                var file = TagLib.File.Create(mp3FilePath);

          
                textBox2.Text = file.Tag.Title;
                textBox3.Text = file.Tag.Album;
                textBox4.Text = file.Tag.Performers.Length > 0 ? file.Tag.Performers[0] : "";
                textBox5.Text = file.Tag.AlbumArtists.Length > 0 ? file.Tag.AlbumArtists[0] : "";
                textBox6.Text = file.Tag.Composers.Length > 0 ? file.Tag.Composers[0] : "";
                textBox7.Text = file.Tag.Genres.Length > 0 ? file.Tag.Genres[0] : "";
                textBox8.Text = file.Tag.Year.ToString();
                textBox9.Text = file.Tag.Comment;
                textBox10.Text= file.Tag.BeatsPerMinute.ToString();
                textBox13.Text = file.Tag.Lyrics;
                
              
            }
            catch (Exception ex)
            {
                MessageBox.Show($"Hata: {ex.Message}", "Hata", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }

        private void button2_Click(object sender, EventArgs e)
        {
      
            string mp3FilePath = textBox1.Text;

            if (string.IsNullOrEmpty(mp3FilePath))
            {
                MessageBox.Show("Lütfen bir MP3 dosyası seçin.", "Hata", MessageBoxButtons.OK, MessageBoxIcon.Error);
                return;
            }

            try
            {

                var file = TagLib.File.Create(mp3FilePath);

                file.RemoveTags(TagTypes.AllTags);

                 //yukardai gibi aldım verdim yabıyoz işte yormayın beni yorum satırı felan
                var tag = file.GetTag(TagTypes.Id3v2, true);
                tag.Title = textBox2.Text;
                tag.Album = textBox3.Text;
                tag.Performers = new[] { textBox4.Text };
                tag.AlbumArtists = new[] { textBox5.Text };
                tag.Composers = new[] { textBox6.Text };
                tag.Genres = new[] { textBox7.Text };
                tag.Year = (uint)int.Parse(textBox8.Text);
                tag.Comment = textBox9.Text;
                tag.BeatsPerMinute = ((uint) int.Parse(textBox10.Text));
                tag.Lyrics = textBox13.Text;

                



                // Değişiklikleri kaydet
                file.Save();

                MessageBox.Show("Tag'ler başarıyla güncellendi.", "Bilgi", MessageBoxButtons.OK, MessageBoxIcon.Information);
            }
            catch (Exception ex)
            {
                MessageBox.Show($"Hata: {ex.Message}", "Hata", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
    }
}
[/SIZE][/COLOR]




Okuduğunuz için teşekkürler.



 

Grimner

Adanmış Üye
28 Mar 2020
6,308
4,733
Elinize sağlık Gmodum, başlık kısmında bana attığınız hali daha iyiydi tabi ama bu da iş görür.
 

Adanalıtrojan

Kıdemli Üye
25 Haz 2021
2,022
1,051
16
Konya Ovası Askeri Tesislerinde
Herkese merhaba arkadaşlar ben kruvazör.
Bugün sizlerle kısaca mp3 dosyalarındaki ID3 taglarını ne işe yaradıklarını konuşacağız ve ardından bu tagları görüntülemek ve değiştirmek için basit bir
c# uygulaması yapacağız.


mp3 tagları
buradan tüm taglara ulaşabilirsiniz.

MP3 ID3 tagleri, MP3 dosyalarındaki içerik hakkında bilgi barındırmak için kullanılan yapılardır. Bu yapı, şarkının adı, sanatçı, albüm ismi, çıkış yılı, bpm ve daha birçok bilgi içerebilir.

Kısaca müzik için detay bilgileri içeren tagler diyebiliriz.

Örneğimize geçelim.

13 textbox
12 label
2 button
1 groupbox

7orjriq.jpg


Üst menüden nuget paketlerine gelelim
licjd3v.jpg


eodfume.jpg


Bu paketi indirdikten sonra kodlarımızı yazmaya başlayabiliriz.



dosya seç buttonuna gelelim ve kodlarımızı ekleyelim

C#:
   private void button1_Click(object sender, EventArgs e)
   {
       using (OpenFileDialog openFileDialog = new OpenFileDialog())  //kullanıcıya filedialog göstererek müzik dosyasını seçmesini sağlıyoruz.
       {
           openFileDialog.Filter = "MP3 Files|*.mp3";
           openFileDialog.Title = "MP3 harici dosya valla kabul etmem";

           if (openFileDialog.ShowDialog() == DialogResult.OK)
           {
               textBox1.Text = openFileDialog.FileName;
               LoadMP3Tags();
           }
       }
   }

LoadMP3Tags isimli bir fonksiyon oluşturalım ve kodlarımızı yazalım
C#:
        private void LoadMP3Tags()
        {
            string mp3FilePath = textBox1.Text;

            // Dosya yolu boş ise işlemi sonlandır
            if (string.IsNullOrEmpty(mp3FilePath))
                return;

            try
            {
           
                var file = TagLib.File.Create(mp3FilePath);

                // Tagleri textboxlara atıyorum
                textBox2.Text = file.Tag.Title;
                textBox3.Text = file.Tag.Album;
                textBox4.Text = file.Tag.Performers.Length > 0 ? file.Tag.Performers[0] : "";
                textBox5.Text = file.Tag.AlbumArtists.Length > 0 ? file.Tag.AlbumArtists[0] : "";
                textBox6.Text = file.Tag.Composers.Length > 0 ? file.Tag.Composers[0] : "";
                textBox7.Text = file.Tag.Genres.Length > 0 ? file.Tag.Genres[0] : "";
                textBox8.Text = file.Tag.Year.ToString();
                textBox9.Text = file.Tag.Comment;
                textBox10.Text= file.Tag.BeatsPerMinute.ToString();
                textBox13.Text = file.Tag.Lyrics;
              
            
            }
            catch (Exception ex)
            {
                MessageBox.Show($"Hata: {ex.Message}", "Hata", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }

Uygula isimli buttona gelelim ve son kez buraya da kodlarımızı yazalım
C#:
 private void button2_Click(object sender, EventArgs e)
 {
     // MP3 dosyasının yolunu al
     string mp3FilePath = textBox1.Text;

     if (string.IsNullOrEmpty(mp3FilePath))
     {
         MessageBox.Show("Lütfen bir MP3 dosyası seçin.", "Hata", MessageBoxButtons.OK, MessageBoxIcon.Error);
         return;
     }

     try
     {
         // TagLib# kullanarak MP3 dosyasının tag şeysilerine bakma
         var file = TagLib.File.Create(mp3FilePath);

         file.RemoveTags(TagTypes.AllTags);

          //yukardai gibi aldım verdim yabıyoz işte yormayın beni yorum satırı felan
         var tag = file.GetTag(TagTypes.Id3v2, true);
         tag.Title = textBox2.Text;
         tag.Album = textBox3.Text;
         tag.Performers = new[] { textBox4.Text };
         tag.AlbumArtists = new[] { textBox5.Text };
         tag.Composers = new[] { textBox6.Text };
         tag.Genres = new[] { textBox7.Text };
         tag.Year = (uint)int.Parse(textBox8.Text);
         tag.Comment = textBox9.Text;
         tag.BeatsPerMinute = ((uint) int.Parse(textBox10.Text));
         tag.Lyrics = textBox13.Text;

      



         // Değişiklikleri kaydet
         file.Save();

         MessageBox.Show("Tag'ler başarıyla güncellendi.", "Bilgi", MessageBoxButtons.OK, MessageBoxIcon.Information);
     }
     catch (Exception ex)
     {
         MessageBox.Show($"Hata: {ex.Message}", "Hata", MessageBoxButtons.OK, MessageBoxIcon.Error);
     }
 }


TEST
sdo9rsn.jpg

s21ik4r.jpg



Gördüğümüz üzere verileri güzel bir biçimde yazıyor ve okuyor.





KODLARIN TAMAMI:
C#:
using System;
[COLOR=rgb(255, 255, 255)][SIZE=5]using System.Windows.Forms;
using TagLib;
namespace Mp3_MetaMaker
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
        }

        private void button1_Click(object sender, EventArgs e)
        {
            using (OpenFileDialog openFileDialog = new OpenFileDialog())
            {
                openFileDialog.Filter = "MP3 Files|*.mp3";
                openFileDialog.Title = "MP3 harici dosya valla kabul etmem";

                if (openFileDialog.ShowDialog() == DialogResult.OK)
                {
                    textBox1.Text = openFileDialog.FileName;

                   
                    LoadMP3Tags();
                }
            }
        }

        private void LoadMP3Tags()
        {
            string mp3FilePath = textBox1.Text;

   
            if (string.IsNullOrEmpty(mp3FilePath))
                return;

            try
            {
              
                var file = TagLib.File.Create(mp3FilePath);

         
                textBox2.Text = file.Tag.Title;
                textBox3.Text = file.Tag.Album;
                textBox4.Text = file.Tag.Performers.Length > 0 ? file.Tag.Performers[0] : "";
                textBox5.Text = file.Tag.AlbumArtists.Length > 0 ? file.Tag.AlbumArtists[0] : "";
                textBox6.Text = file.Tag.Composers.Length > 0 ? file.Tag.Composers[0] : "";
                textBox7.Text = file.Tag.Genres.Length > 0 ? file.Tag.Genres[0] : "";
                textBox8.Text = file.Tag.Year.ToString();
                textBox9.Text = file.Tag.Comment;
                textBox10.Text= file.Tag.BeatsPerMinute.ToString();
                textBox13.Text = file.Tag.Lyrics;
               
             
            }
            catch (Exception ex)
            {
                MessageBox.Show($"Hata: {ex.Message}", "Hata", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }

        private void button2_Click(object sender, EventArgs e)
        {
     
            string mp3FilePath = textBox1.Text;

            if (string.IsNullOrEmpty(mp3FilePath))
            {
                MessageBox.Show("Lütfen bir MP3 dosyası seçin.", "Hata", MessageBoxButtons.OK, MessageBoxIcon.Error);
                return;
            }

            try
            {

                var file = TagLib.File.Create(mp3FilePath);

                file.RemoveTags(TagTypes.AllTags);

                 //yukardai gibi aldım verdim yabıyoz işte yormayın beni yorum satırı felan
                var tag = file.GetTag(TagTypes.Id3v2, true);
                tag.Title = textBox2.Text;
                tag.Album = textBox3.Text;
                tag.Performers = new[] { textBox4.Text };
                tag.AlbumArtists = new[] { textBox5.Text };
                tag.Composers = new[] { textBox6.Text };
                tag.Genres = new[] { textBox7.Text };
                tag.Year = (uint)int.Parse(textBox8.Text);
                tag.Comment = textBox9.Text;
                tag.BeatsPerMinute = ((uint) int.Parse(textBox10.Text));
                tag.Lyrics = textBox13.Text;

               



                // Değişiklikleri kaydet
                file.Save();

                MessageBox.Show("Tag'ler başarıyla güncellendi.", "Bilgi", MessageBoxButtons.OK, MessageBoxIcon.Information);
            }
            catch (Exception ex)
            {
                MessageBox.Show($"Hata: {ex.Message}", "Hata", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
    }
}
[/SIZE][/COLOR]




Okuduğunuz için teşekkürler.



Çok güzel bir konu olmuş Abi Eline emeğine sağlık
 

Kruvazör

Yazılım Ekibi Lideri
28 Mar 2020
1,724
2,542
Wrong Side Of Heaven
Elinize sağlık Gmodum, başlık kısmında bana attığınız hali daha iyiydi tabi ama bu da iş görür.

Eline sağlık ustam ama beni karıştırmasan olmazmıydı 😂

Çok güzel bir konu olmuş Abi Eline emeğine sağlık

Eline sağlık abi.

Eline sağlık abi.

Hocam ellerinize sağlık
teşekkürler :)
 

Zwo

Katılımcı Üye
Herkese merhaba arkadaşlar ben kruvazör.
Bugün sizlerle kısaca mp3 dosyalarındaki ID3 taglarını ne işe yaradıklarını konuşacağız ve ardından bu tagları görüntülemek ve değiştirmek için basit bir
c# uygulaması yapacağız.


mp3 tagları
buradan tüm taglara ulaşabilirsiniz.

MP3 ID3 tagleri, MP3 dosyalarındaki içerik hakkında bilgi barındırmak için kullanılan yapılardır. Bu yapı, şarkının adı, sanatçı, albüm ismi, çıkış yılı, bpm ve daha birçok bilgi içerebilir.

Kısaca müzik için detay bilgileri içeren tagler diyebiliriz.

Örneğimize geçelim.

13 textbox
12 label
2 button
1 groupbox

7orjriq.jpg


Üst menüden nuget paketlerine gelelim
licjd3v.jpg


eodfume.jpg


Bu paketi indirdikten sonra kodlarımızı yazmaya başlayabiliriz.



dosya seç buttonuna gelelim ve kodlarımızı ekleyelim

C#:
   private void button1_Click(object sender, EventArgs e)
   {
       using (OpenFileDialog openFileDialog = new OpenFileDialog())  //kullanıcıya filedialog göstererek müzik dosyasını seçmesini sağlıyoruz.
       {
           openFileDialog.Filter = "MP3 Files|*.mp3";
           openFileDialog.Title = "MP3 harici dosya valla kabul etmem";

           if (openFileDialog.ShowDialog() == DialogResult.OK)
           {
               textBox1.Text = openFileDialog.FileName;
               LoadMP3Tags();
           }
       }
   }

LoadMP3Tags isimli bir fonksiyon oluşturalım ve kodlarımızı yazalım
C#:
        private void LoadMP3Tags()
        {
            string mp3FilePath = textBox1.Text;

            // Dosya yolu boş ise işlemi sonlandır
            if (string.IsNullOrEmpty(mp3FilePath))
                return;

            try
            {
           
                var file = TagLib.File.Create(mp3FilePath);

                // Tagleri textboxlara atıyorum
                textBox2.Text = file.Tag.Title;
                textBox3.Text = file.Tag.Album;
                textBox4.Text = file.Tag.Performers.Length > 0 ? file.Tag.Performers[0] : "";
                textBox5.Text = file.Tag.AlbumArtists.Length > 0 ? file.Tag.AlbumArtists[0] : "";
                textBox6.Text = file.Tag.Composers.Length > 0 ? file.Tag.Composers[0] : "";
                textBox7.Text = file.Tag.Genres.Length > 0 ? file.Tag.Genres[0] : "";
                textBox8.Text = file.Tag.Year.ToString();
                textBox9.Text = file.Tag.Comment;
                textBox10.Text= file.Tag.BeatsPerMinute.ToString();
                textBox13.Text = file.Tag.Lyrics;
              
            
            }
            catch (Exception ex)
            {
                MessageBox.Show($"Hata: {ex.Message}", "Hata", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }

Uygula isimli buttona gelelim ve son kez buraya da kodlarımızı yazalım
C#:
 private void button2_Click(object sender, EventArgs e)
 {
     // MP3 dosyasının yolunu al
     string mp3FilePath = textBox1.Text;

     if (string.IsNullOrEmpty(mp3FilePath))
     {
         MessageBox.Show("Lütfen bir MP3 dosyası seçin.", "Hata", MessageBoxButtons.OK, MessageBoxIcon.Error);
         return;
     }

     try
     {
         // TagLib# kullanarak MP3 dosyasının tag şeysilerine bakma
         var file = TagLib.File.Create(mp3FilePath);

         file.RemoveTags(TagTypes.AllTags);

          //yukardai gibi aldım verdim yabıyoz işte yormayın beni yorum satırı felan
         var tag = file.GetTag(TagTypes.Id3v2, true);
         tag.Title = textBox2.Text;
         tag.Album = textBox3.Text;
         tag.Performers = new[] { textBox4.Text };
         tag.AlbumArtists = new[] { textBox5.Text };
         tag.Composers = new[] { textBox6.Text };
         tag.Genres = new[] { textBox7.Text };
         tag.Year = (uint)int.Parse(textBox8.Text);
         tag.Comment = textBox9.Text;
         tag.BeatsPerMinute = ((uint) int.Parse(textBox10.Text));
         tag.Lyrics = textBox13.Text;

      



         // Değişiklikleri kaydet
         file.Save();

         MessageBox.Show("Tag'ler başarıyla güncellendi.", "Bilgi", MessageBoxButtons.OK, MessageBoxIcon.Information);
     }
     catch (Exception ex)
     {
         MessageBox.Show($"Hata: {ex.Message}", "Hata", MessageBoxButtons.OK, MessageBoxIcon.Error);
     }
 }


TEST
sdo9rsn.jpg

s21ik4r.jpg



Gördüğümüz üzere verileri güzel bir biçimde yazıyor ve okuyor.





KODLARIN TAMAMI:
C#:
using System;
[COLOR=rgb(255, 255, 255)][SIZE=5]using System.Windows.Forms;
using TagLib;
namespace Mp3_MetaMaker
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
        }

        private void button1_Click(object sender, EventArgs e)
        {
            using (OpenFileDialog openFileDialog = new OpenFileDialog())
            {
                openFileDialog.Filter = "MP3 Files|*.mp3";
                openFileDialog.Title = "MP3 harici dosya valla kabul etmem";

                if (openFileDialog.ShowDialog() == DialogResult.OK)
                {
                    textBox1.Text = openFileDialog.FileName;

                   
                    LoadMP3Tags();
                }
            }
        }

        private void LoadMP3Tags()
        {
            string mp3FilePath = textBox1.Text;

   
            if (string.IsNullOrEmpty(mp3FilePath))
                return;

            try
            {
              
                var file = TagLib.File.Create(mp3FilePath);

         
                textBox2.Text = file.Tag.Title;
                textBox3.Text = file.Tag.Album;
                textBox4.Text = file.Tag.Performers.Length > 0 ? file.Tag.Performers[0] : "";
                textBox5.Text = file.Tag.AlbumArtists.Length > 0 ? file.Tag.AlbumArtists[0] : "";
                textBox6.Text = file.Tag.Composers.Length > 0 ? file.Tag.Composers[0] : "";
                textBox7.Text = file.Tag.Genres.Length > 0 ? file.Tag.Genres[0] : "";
                textBox8.Text = file.Tag.Year.ToString();
                textBox9.Text = file.Tag.Comment;
                textBox10.Text= file.Tag.BeatsPerMinute.ToString();
                textBox13.Text = file.Tag.Lyrics;
               
             
            }
            catch (Exception ex)
            {
                MessageBox.Show($"Hata: {ex.Message}", "Hata", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }

        private void button2_Click(object sender, EventArgs e)
        {
     
            string mp3FilePath = textBox1.Text;

            if (string.IsNullOrEmpty(mp3FilePath))
            {
                MessageBox.Show("Lütfen bir MP3 dosyası seçin.", "Hata", MessageBoxButtons.OK, MessageBoxIcon.Error);
                return;
            }

            try
            {

                var file = TagLib.File.Create(mp3FilePath);

                file.RemoveTags(TagTypes.AllTags);

                 //yukardai gibi aldım verdim yabıyoz işte yormayın beni yorum satırı felan
                var tag = file.GetTag(TagTypes.Id3v2, true);
                tag.Title = textBox2.Text;
                tag.Album = textBox3.Text;
                tag.Performers = new[] { textBox4.Text };
                tag.AlbumArtists = new[] { textBox5.Text };
                tag.Composers = new[] { textBox6.Text };
                tag.Genres = new[] { textBox7.Text };
                tag.Year = (uint)int.Parse(textBox8.Text);
                tag.Comment = textBox9.Text;
                tag.BeatsPerMinute = ((uint) int.Parse(textBox10.Text));
                tag.Lyrics = textBox13.Text;

               



                // Değişiklikleri kaydet
                file.Save();

                MessageBox.Show("Tag'ler başarıyla güncellendi.", "Bilgi", MessageBoxButtons.OK, MessageBoxIcon.Information);
            }
            catch (Exception ex)
            {
                MessageBox.Show($"Hata: {ex.Message}", "Hata", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
    }
}
[/SIZE][/COLOR]




Okuduğunuz için teşekkürler.



Elinize sağlık hocam çok güzel proje ve anlatım olmuş
 
Üst

Turkhackteam.org internet sitesi 5651 sayılı kanun’un 2. maddesinin 1. fıkrasının m) bendi ile aynı kanunun 5. maddesi kapsamında "Yer Sağlayıcı" konumundadır. İçerikler ön onay olmaksızın tamamen kullanıcılar tarafından oluşturulmaktadır. Turkhackteam.org; Yer sağlayıcı olarak, kullanıcılar tarafından oluşturulan içeriği ya da hukuka aykırı paylaşımı kontrol etmekle ya da araştırmakla yükümlü değildir. Türkhackteam saldırı timleri Türk sitelerine hiçbir zararlı faaliyette bulunmaz. Türkhackteam üyelerinin yaptığı bireysel hack faaliyetlerinden Türkhackteam sorumlu değildir. Sitelerinize Türkhackteam ismi kullanılarak hack faaliyetinde bulunulursa, site-sunucu erişim loglarından bu faaliyeti gerçekleştiren ip adresini tespit edip diğer kanıtlarla birlikte savcılığa suç duyurusunda bulununuz.