C#里OCX控件注册的方法

//using System.Diagnostics;
//filePath=“xxx.ocx”;

Process p = new Process();
p.StartInfo.FileName = "Regsvr32.exe";
p.StartInfo.Arguments = "/s " + filePath; //路径中不能有空格
p.Start();

不判断是否已经注册可用,因为重复注册将覆盖原注册表项

posted @ 2012-06-12 10:36  Jim_技迷  阅读(251)  评论(0编辑  收藏  举报