首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > .NET > C# >

怎么用C#编写COM组件

2012-01-09 
如何用C#编写COM组件?现在要用C#写一个组件(.dll),别的平台也可以调用的,不知道如何做,请教各位。[解决办法

如何用C#编写COM组件?
现在要用C#写一个组件(.dll),别的平台也可以调用的,不知道如何做,请教各位。

[解决办法]
com+一般咬用到下面命名空间
using System.EnterpriseServices;
例如

C# code
[ConstructionEnabledAttribute(Default="ILAssembly V1.0")]    [JustInTimeActivation(true)]    [Transaction(TransactionOption.Supported)]    [ObjectPooling(true, 1, 5)]    [Serializable()]    public class testcom+ : ServicedComponent, IDisposable       {          //里面随便写你的函数       } 

热点排行