开发者

Is it possible to reference a .NET assembly from ColdFusion?

Is it possible to reference a .NET assembly from ColdFusion? If so, how can I accomplish this? I am not a ColdFusion developer by 开发者_StackOverflow社区any means.


You can call .net Assemblies directly since CF8.

Example:

<cfobject type=".NET" name="mathInstance" class="mathClass"
          assembly="C:/Net/Assemblies/math.dll">
<cfset myVar = mathInstance.multiply(1,2)>

or

mathInstance = CreateObject(".NET", "mathClass", "C:/Net/Assemblies/math.dll");
myVar = mathInstance.multiply(1,2);

CF8 Doc - Using Microsoft .NET Assemblies

CF9 Doc - Using Microsoft .NET Assemblies

JNBridgePro is used under the hood to make this possible. Reference: BlueDragon.NET versus CF8 .NET Integration: Architecture.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜