在Windows应用程序中实现VLC播放器:以编程方式注册ActiveX组件

我使用以下指南在我的Windows应用程序中实现VLC播放器:

http://www.codeproject.com/Questions/163016/How-to-embed-VLC-control-in-c-net-windows-applicat

(见评价最高的答案)

在指南的第2步,它说我必须注册ActiveX组件:

regsvr32 "D:\Program Files\VideoLAN\VLC\axvlc.dll" 

如何在软件中以编程方式执行此操作,以便用户不必执行此操作? 我不确定如何在这里继续。 谁能帮我?

请尝试此例程注册您的dll

  public static void RegisterDll(string filePath) { string fileinfo = String.Format(@"/s ""{0}""", filePath); Process process = new Process(); process.StartInfo.FileName = "regsvr32.exe"; process.StartInfo.Arguments = fileinfo; process.StartInfo.UseShellExecute = false; process.StartInfo.CreateNoWindow = true; process.StartInfo.RedirectStandardOutput = true; process.Start(); process.WaitForExit(); process.Close(); }