[EnterpriseServices]利用assembly定义我们的组件在COM+中的注册方式
来源:互联网 发布:c语言void用法 编辑:程序博客网 时间:2024/05/12 14:21
利用以下assembly定义我们的组件在COM+中的注册方式,其中:
ApplicationName 属性是"COM+ 目录"和"组件服务管理"控制台中显示的 COM+ 应用程序的名称。
[assembly: ApplicationName("MyDLL.Interface")]
Description属性为"COM+ 目录"和"组件服务管理"控制台中的 COM+ 应用程序提供说明。
[assembly: Description("My Serviced Component")]
ActivationOption 属性指示是否在调用方的进程中激活组件。我们这里将 Activation.Option 设置为服务器,意即“组件将在专用服务器进程中被激活”。
[assembly:ApplicationActivation(ActivationOption.Server)]
ApplicationAccessControl属性设置访问管理和验证级别。这里我们设置:不对此应用程序强制进行访问权限检查;调用的身份验证级别为无;模拟级别为委派。
[assembly: ApplicationAccessControl(Value=false,
ImpersonationLevel=ImpersonationLevelOption.Delegate,
Authentication=AuthenticationOption.None)]
代码中实现了以上定义后,就可以简单地通过
regsvcs MyDLL.DLL或者通过下面的类定义来注册我们的COM+组件,调用方法是:
“string strComPlusDLLFilePath = RootForumsDirectory + @"/bin/MyDLL.dll";
UltraPower.InstallClassLib.InstallClassRegsvcs.Install(strComPlusDLLFilePath);”
就可以免手工配置COM+应用了,省去了许多麻烦。
{
public class InstallClassRegsvcs
{
public InstallClassRegsvcs()
{
}
Install#region Install
//---Override the 'Install' method.
public static void Install(string strComPlusDLLFilePath)
{
//---checkpoint
Trace.WriteLine(string.Format("注册COM+组件 {0}", strComPlusDLLFilePath));
//---action
Process installProcess = new Process();
ProcessStartInfo installInfo = new ProcessStartInfo("regsvcs.exe");
installInfo.Arguments = " " + strComPlusDLLFilePath;
installInfo.WindowStyle = ProcessWindowStyle.Hidden;
installProcess.StartInfo = installInfo;
//run
installProcess.Start();
installProcess.WaitForExit();
}
#endregion
}
}
{
public class InstallClassRegsvcs
{
public InstallClassRegsvcs()
{
}
Install#region Install
//---Override the 'Install' method.
public static void Install(string strComPlusDLLFilePath)
{
//---checkpoint
Trace.WriteLine(string.Format("注册COM+组件 {0}", strComPlusDLLFilePath));
//---action
Process installProcess = new Process();
ProcessStartInfo installInfo = new ProcessStartInfo("regsvcs.exe");
installInfo.Arguments = " " + strComPlusDLLFilePath;
installInfo.WindowStyle = ProcessWindowStyle.Hidden;
installProcess.StartInfo = installInfo;
//run
installProcess.Start();
installProcess.WaitForExit();
}
#endregion
}
}
利用以下assembly定义我们的组件在COM+中的注册方式,其中:
ApplicationName 属性是"COM+ 目录"和"组件服务管理"控制台中显示的 COM+ 应用程序的名称。
[assembly: ApplicationName("MyDLL.Interface")]
Description属性为"COM+ 目录"和"组件服务管理"控制台中的 COM+ 应用程序提供说明。
[assembly: Description("My Serviced Component")]
ActivationOption 属性指示是否在调用方的进程中激活组件。我们这里将 Activation.Option 设置为服务器,意即“组件将在专用服务器进程中被激活”。
[assembly:ApplicationActivation(ActivationOption.Server)]
ApplicationAccessControl属性设置访问管理和验证级别。这里我们设置:不对此应用程序强制进行访问权限检查;调用的身份验证级别为无;模拟级别为委派。
[assembly: ApplicationAccessControl(Value=false,
ImpersonationLevel=ImpersonationLevelOption.Delegate,
Authentication=AuthenticationOption.None)]
代码中实现了以上定义后,就可以简单地通过
regsvcs MyDLL.DLL或者通过下面的类定义来注册我们的COM+组件,调用方法是:
“string strComPlusDLLFilePath = RootForumsDirectory + @"/bin/MyDLL.dll";
UltraPower.InstallClassLib.InstallClassRegsvcs.Install(strComPlusDLLFilePath);”
就可以免手工配置COM+应用了,省去了许多麻烦。
{
public class InstallClassRegsvcs
{
public InstallClassRegsvcs()
{
}
Install#region Install
//---Override the 'Install' method.
public static void Install(string strComPlusDLLFilePath)
{
//---checkpoint
Trace.WriteLine(string.Format("注册COM+组件 {0}", strComPlusDLLFilePath));
//---action
Process installProcess = new Process();
ProcessStartInfo installInfo = new ProcessStartInfo("regsvcs.exe");
installInfo.Arguments = " " + strComPlusDLLFilePath;
installInfo.WindowStyle = ProcessWindowStyle.Hidden;
installProcess.StartInfo = installInfo;
//run
installProcess.Start();
installProcess.WaitForExit();
}
#endregion
}
}
{
public class InstallClassRegsvcs
{
public InstallClassRegsvcs()
{
}
Install#region Install
//---Override the 'Install' method.
public static void Install(string strComPlusDLLFilePath)
{
//---checkpoint
Trace.WriteLine(string.Format("注册COM+组件 {0}", strComPlusDLLFilePath));
//---action
Process installProcess = new Process();
ProcessStartInfo installInfo = new ProcessStartInfo("regsvcs.exe");
installInfo.Arguments = " " + strComPlusDLLFilePath;
installInfo.WindowStyle = ProcessWindowStyle.Hidden;
installProcess.StartInfo = installInfo;
//run
installProcess.Start();
installProcess.WaitForExit();
}
#endregion
}
}
利用以下assembly定义我们的组件在COM+中的注册方式,其中:
ApplicationName 属性是"COM+ 目录"和"组件服务管理"控制台中显示的 COM+ 应用程序的名称。
[assembly: ApplicationName("MyDLL.Interface")]
Description属性为"COM+ 目录"和"组件服务管理"控制台中的 COM+ 应用程序提供说明。
[assembly: Description("My Serviced Component")]
ActivationOption 属性指示是否在调用方的进程中激活组件。我们这里将 Activation.Option 设置为服务器,意即“组件将在专用服务器进程中被激活”。
[assembly:ApplicationActivation(ActivationOption.Server)]
ApplicationAccessControl属性设置访问管理和验证级别。这里我们设置:不对此应用程序强制进行访问权限检查;调用的身份验证级别为无;模拟级别为委派。
[assembly: ApplicationAccessControl(Value=false,
ImpersonationLevel=ImpersonationLevelOption.Delegate,
Authentication=AuthenticationOption.None)]
代码中实现了以上定义后,就可以简单地通过
regsvcs MyDLL.DLL或者通过下面的类定义来注册我们的COM+组件,调用方法是:
“string strComPlusDLLFilePath = RootForumsDirectory + @"/bin/MyDLL.dll";
UltraPower.InstallClassLib.InstallClassRegsvcs.Install(strComPlusDLLFilePath);”
就可以免手工配置COM+应用了,省去了许多麻烦。
{
public class InstallClassRegsvcs
{
public InstallClassRegsvcs()
{
}
Install#region Install
//---Override the 'Install' method.
public static void Install(string strComPlusDLLFilePath)
{
//---checkpoint
Trace.WriteLine(string.Format("注册COM+组件 {0}", strComPlusDLLFilePath));
//---action
Process installProcess = new Process();
ProcessStartInfo installInfo = new ProcessStartInfo("regsvcs.exe");
installInfo.Arguments = " " + strComPlusDLLFilePath;
installInfo.WindowStyle = ProcessWindowStyle.Hidden;
installProcess.StartInfo = installInfo;
//run
installProcess.Start();
installProcess.WaitForExit();
}
#endregion
}
}
{
public class InstallClassRegsvcs
{
public InstallClassRegsvcs()
{
}
Install#region Install
//---Override the 'Install' method.
public static void Install(string strComPlusDLLFilePath)
{
//---checkpoint
Trace.WriteLine(string.Format("注册COM+组件 {0}", strComPlusDLLFilePath));
//---action
Process installProcess = new Process();
ProcessStartInfo installInfo = new ProcessStartInfo("regsvcs.exe");
installInfo.Arguments = " " + strComPlusDLLFilePath;
installInfo.WindowStyle = ProcessWindowStyle.Hidden;
installProcess.StartInfo = installInfo;
//run
installProcess.Start();
installProcess.WaitForExit();
}
#endregion
}
}
利用以下assembly定义我们的组件在COM+中的注册方式,其中:
ApplicationName 属性是"COM+ 目录"和"组件服务管理"控制台中显示的 COM+ 应用程序的名称。
[assembly: ApplicationName("MyDLL.Interface")]
Description属性为"COM+ 目录"和"组件服务管理"控制台中的 COM+ 应用程序提供说明。
[assembly: Description("My Serviced Component")]
ActivationOption 属性指示是否在调用方的进程中激活组件。我们这里将 Activation.Option 设置为服务器,意即“组件将在专用服务器进程中被激活”。
[assembly:ApplicationActivation(ActivationOption.Server)]
ApplicationAccessControl属性设置访问管理和验证级别。这里我们设置:不对此应用程序强制进行访问权限检查;调用的身份验证级别为无;模拟级别为委派。
[assembly: ApplicationAccessControl(Value=false,
ImpersonationLevel=ImpersonationLevelOption.Delegate,
Authentication=AuthenticationOption.None)]
代码中实现了以上定义后,就可以简单地通过
regsvcs MyDLL.DLL或者通过下面的类定义来注册我们的COM+组件,调用方法是:
“string strComPlusDLLFilePath = RootForumsDirectory + @"/bin/MyDLL.dll";
UltraPower.InstallClassLib.InstallClassRegsvcs.Install(strComPlusDLLFilePath);”
就可以免手工配置COM+应用了,省去了许多麻烦。
{
public class InstallClassRegsvcs
{
public InstallClassRegsvcs()
{
}
Install#region Install
//---Override the 'Install' method.
public static void Install(string strComPlusDLLFilePath)
{
//---checkpoint
Trace.WriteLine(string.Format("注册COM+组件 {0}", strComPlusDLLFilePath));
//---action
Process installProcess = new Process();
ProcessStartInfo installInfo = new ProcessStartInfo("regsvcs.exe");
installInfo.Arguments = " " + strComPlusDLLFilePath;
installInfo.WindowStyle = ProcessWindowStyle.Hidden;
installProcess.StartInfo = installInfo;
//run
installProcess.Start();
installProcess.WaitForExit();
}
#endregion
}
}
{
public class InstallClassRegsvcs
{
public InstallClassRegsvcs()
{
}
Install#region Install
//---Override the 'Install' method.
public static void Install(string strComPlusDLLFilePath)
{
//---checkpoint
Trace.WriteLine(string.Format("注册COM+组件 {0}", strComPlusDLLFilePath));
//---action
Process installProcess = new Process();
ProcessStartInfo installInfo = new ProcessStartInfo("regsvcs.exe");
installInfo.Arguments = " " + strComPlusDLLFilePath;
installInfo.WindowStyle = ProcessWindowStyle.Hidden;
installProcess.StartInfo = installInfo;
//run
installProcess.Start();
installProcess.WaitForExit();
}
#endregion
}
}
- [EnterpriseServices]利用assembly定义我们的组件在COM+中的注册方式
- [EnterpriseServices]利用assembly定义我们的组件在COM+中的注册方式
- 开发常见错误解决(1)注册.NET EnterpriseServices COM+组件,事务服务不可用
- 利用RegSvr32来注册.NET COM组件
- 利用RegSvr32来注册.NET COM组件
- 利用IE浏览器的Com组件在WinForm中显示资源中的HTML文件
- 利用IE浏览器的Com组件在WinForm中显示资源中的HTML文
- com组件的注册and反注册
- 在C#下利用COM组件提供给第三方调用,无需强命名,通过CurrentDomain_AssemblyResolve方式的解决的过程
- 如何在wince下注册COM组件?
- 利用现有的COM组件
- 创建COM组件的实现(或者叫作注册Com组件)
- 利用atl中注册com组件的方法来访问注册表
- React 中的 定义组件的 两种方式
- .net 注册COM+应用组件的步骤
- 两种注册COM组件的方法
- com+组件的注册,卸载和管理
- 手工加载未注册的 COM 组件
- [WiX]我的第一个WiX安装脚本
- [LCS]启用WindowsMessenger5.0的调试日志功能来诊断登录LCS服务器
- 赵勖予:再见,CodeArtist(下)
- [收藏]再见,CodeArtist
- [C#]I/O完成端口的类定义和测试实例
- [EnterpriseServices]利用assembly定义我们的组件在COM+中的注册方式
- a gcc compiler optimization problem from my colleague
- [C#]I/O完成端口的实现
- 离开几天
- [GOLF]过了磨合期了
- [C#]如何将自定义的structure转换为byte[]?
- 超级卓越企业
- Proxy Pattern (代理模式)
- [dotNET]“ThreadPool 对象中没有足够的自由线程来完成操作”的现象和解决办法