问题
Im using the following guide to implement a VLC player inside my windows application:
http://www.codeproject.com/Questions/163016/How-to-embed-VLC-control-in-c-net-windows-applicat
(see the top rated answer)
On step 2 in the guide, it says that I have to register the ActiveX component:
regsvr32 "D:\Program Files\VideoLAN\VLC\axvlc.dll"
How do I do this programatically in the software so that the user doesn't have to? Im unsure on how to proceed here. Can anyone help me?
回答1:
Please try this routine to register your dlls
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();
}
来源:https://stackoverflow.com/questions/10385686/implementing-vlc-player-in-a-windows-application-programatically-registering-an