string zfile = AppDomain.CurrentDomain.BaseDirectory + @"ImportExcelBill.dll";
RegistrationServices d = new RegistrationServices();
Assembly asm = Assembly.LoadFrom(zfile);
d.RegisterAssembly(asm, AssemblyRegistrationFlags.None);
以上代码是注册,需要一定权限,譬如管理员权限
然后调用com
Type type = Type.GetTypeFromProgID("ImportExcelBill.ICMOList");
dynamic act = Activator.CreateInstance(type);
act.MainFunction("FMenuICMOBillNo", null, false);
ImportExcelBill.dll是dotnet编写的com组件