Пример #1
0
        private void button2_Click(object sender, EventArgs e)
        {
            using (OpenFileDialog dlg = new OpenFileDialog())
            {
                dlg.Filter           = "Mp3 File|*.mp3";
                dlg.InitialDirectory = Environment.GetFolderPath(Environment.SpecialFolder.MyComputer);

                if (dlg.ShowDialog() == System.Windows.Forms.DialogResult.OK)
                {
                    mp3Player = new MP3(dlg.FileName);
                }
            }
        }
Пример #2
0
        private void listBox1_SelectedIndexChanged(object sender, EventArgs e)
        {
            if (mp3Player != null)
            {
                mp3Player.Stop();
            }
            string path = listBox1.SelectedItem.ToString();

            mp3Player = new MP3(path);
            if (mp3Player != null)
            {
                mp3Player.Play();
            }
        }