Advertisement
Guest User

Untitled

a guest
Mar 25th, 2017
74
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.56 KB | None | 0 0
  1. using System.Diagnostics;
  2. public static void registerDLL(string dllPath)
  3. {
  4. try {
  5. //'/s' : indicates regsvr32.exe to run silently.
  6. string fileinfo = "/s" + " " + "\"" + dllPath + "\"";
  7.  
  8. Process reg = new Process();
  9. reg.StartInfo.FileName = "regsvr32.exe";
  10. reg.StartInfo.Arguments = fileinfo;
  11. reg.StartInfo.UseShellExecute = false;
  12. reg.StartInfo.CreateNoWindow = true;
  13. reg.StartInfo.RedirectStandardOutput = true;
  14. reg.Start();
  15. reg.WaitForExit();
  16. reg.Close();
  17. }
  18. catch(Exception ex) {
  19. MessageBox.Show(ex.Message);
  20. }
  21. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement