示例#1
0
 private void closeButton_Click(object sender, System.EventArgs e)
 {
     try
     {
         mci.Close();
     }
     catch (Exception ex)
     {
         MessageBox.Show(ex.Message, Application.ProductName, MessageBoxButtons.OK, MessageBoxIcon.Error);
     }
 }
示例#2
0
        static void Main(string[] args)
        {
            string fileName = Path.Combine(Application.StartupPath, "Club Generation - Patience.mp3");

            try
            {
                // Leider funktioniert MCI (auf jeden Fall auf meinem XP-System)
                // nicht in einer Konsolenanwendung
                Mci mci = new Mci();
                mci.Open(fileName);
                mci.Play(true);
                Console.WriteLine("Abspielen beenden mit Return");
                mci.Close();
            }
            catch (Exception ex)
            {
                Console.WriteLine(ex.Message);
            }



            Console.WriteLine("Beenden mit Return");
            Console.ReadLine();
        }