I'm writing a windows application. I have media player in my form. When I set the URL to something like "fsgfbnhgb" (something wrong!) the player by itself shows an error. But it's not good. I have "try" and "catch" blocks and in try block there isn't any exceptions when URL is "fgdsfgasgfas"! Because the player by itself catches the exception. How can I set error for media player by myself?
try
{
player.URL = "fdgsdgsdg";
player.Ctlcontrols.play();
}
catch
{
snd.Play();
MessageBox.Show("An error occurred during reading the alarm music path. Check that its directory is valid.", "Alarm music error", MessageBoxButtons.OK, MessageBoxIcon.Error);
}
Thank you all