Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System.Diagnostics;
- …
- public static void registerDLL(string dllPath)
- {
- try {
- //'/s' : indicates regsvr32.exe to run silently.
- string fileinfo = "/s" + " " + "\"" + dllPath + "\"";
- Process reg = new Process();
- reg.StartInfo.FileName = "regsvr32.exe";
- reg.StartInfo.Arguments = fileinfo;
- reg.StartInfo.UseShellExecute = false;
- reg.StartInfo.CreateNoWindow = true;
- reg.StartInfo.RedirectStandardOutput = true;
- reg.Start();
- reg.WaitForExit();
- reg.Close();
- }
- catch(Exception ex) {
- MessageBox.Show(ex.Message);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement