내 코드에 문제가 있습니다. 내 프로젝트에서 OpenFileDialog를 사용하고 ShowDialog 메서드를 호출하면 예외가 발생합니다. 나는 왜 그런지 이해하지 못한다. 잘못된 매개 변수C# 및 WPF, ShowFIleDialog excption 던졌습니다
누군가가 나를 도울 수 :
private void open_FileMenu(object sender, RoutedEventArgs e)
{
OpenFileDialog browser = new OpenFileDialog();
browser.AddExtension = true;
browser.Filter = "Audio, Video File | *.wma; *.mp3; *.wmv";
browser.Title = "Choose your file";
if (browser.ShowDialog() == System.Windows.Forms.DialogResult.Yes) // Exception thrown here
{
try
{
string FileName = browser.FileName;
MyMedia.Source = new Uri(FileName);
}
catch (Exception ex)
{
Console.Write(ex.Message);
}
}
이 예외는
A first chance exception of type 'System.ComponentModel.Win32Exception' occurred in WindowsBase.dl
추가 정보는 말했다?
는 http://stackoverflow.com/questions/6283804/a-first-chance-exception-of-type-system-componentmodel-win32exception-occurred –
의 중복처럼 보인다. 고맙습니다 – Gims