在vs2010里面调试是好好的。但是生成安装包安装之后,一点击“打开”菜单,程序就退出了。不知道是什么问题。以前重来没碰到过。一下是“打开”菜单的事件函数。哪位碰到过这样的情况???
private void fileMenu_Click(object sender, RoutedEventArgs e)
{
System.Windows.Forms.OpenFileDialog open = new System.Windows.Forms.OpenFileDialog();
open.Multiselect = false;
open.Filter = "Video Files(*.avi;*.rmvb;*.flv;*.mp4)|*.avi;*.rmvb;*.flv;*.mp4|All Files(*.*)|*.*";
//open.ShowDialog();
if (open.ShowDialog() == System.Windows.Forms.DialogResult.OK)
{
if (null != videoSource && videoSource.IsRunning)
{
videoSource.Stop();
}
if (null == videoSource)
{
videoSource = new AForge.Video.FFMPEG.VideoFileSource(open.FileName);
videoSource.NewFrame += new AForge.Video.NewFrameEventHandler(videoSource_NewFrame);
}
else
{
videoSource.Source = open.FileName;
}
}
}