我想在 C# 中运行非常简单的 videoplayer windows 窗体应用程序,但是当我单击按钮播放视频时,出现此错误:
"An unhandled exception of type 'System.IO.FileLoadException' occurred in System.Windows.Forms.dll"
Form1.cs:
using Microsoft.DirectX.AudioVideoPlayback;
namespace videoplayer
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private void button1_Click(object sender, EventArgs e)
{
Video myVid = new Video("d:\\vids.avi");
myVid.Owner = panel1;
myVid.Play();
}
}
}
异常错误参考 Program.cs :
namespace videoplayer
{
static class Program
{
[STAThread]
static void Main()
{
Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false);
Application.Run(new Form1()); //exception error here
}
}
}
谢谢