从Java应用程序调用C#dll

时间:2022-07-02 15:06:11

I have a dll created in c# which does some database operation upon calling. I have to pass few parameters from a Java application to a method in the dll. Any Idea on how to do this.

我在c#中创建了一个dll,它在调用时执行一些数据库操作。我必须将一些参数从Java应用程序传递给dll中的方法。关于如何做到这一点的任何想法。

OR

Any better ideas for calling a method in c# by a java application?

有没有更好的想法在java应用程序中调用c#中的方法?

Thanks

Edit : My java application is a standard Dialogue Designer application from AVAYA Platform and I have developed a C# application which works on a SDK for .net only. So i need data to be passed from java application to .net application

编辑:我的Java应用程序是AVAYA平台的标准Dialogue Designer应用程序,我开发了一个C#应用程序,仅适用于.net的SDK。所以我需要将数据从java应用程序传递到.net应用程序

2 个解决方案

#1


1  

I looked into this a while back although I enver got far with it as the requirements changed. But I did read that using JNI, Java Native Interface may be able to help you with what you are needing to do.

我一会儿看了这个,虽然随着要求的改变,我已经很顺利了。但我确实读到了使用JNI,Java Native Interface可能能够帮助您完成您需要做的事情。

http://java.sun.com/developer/onlineTraining/Programming/JDCBook/jni.html

Hope this helps!

希望这可以帮助!

#2


2  

IKVM.NET is an implementation of Java for Mono and the Microsoft .NET Framework. It includes the following components:

IKVM.NET是Mono和Microsoft .NET Framework的Java实现。它包括以下组件:

  • A Java Virtual Machine implemented in .NET
  • 用.NET实现的Java虚拟机

  • A .NET implementation of the Java class libraries
  • Java类库的.NET实现

  • Tools that enable Java and .NET interoperability
  • 支持Java和.NET互操作性的工具

The third point is maybe what you are looking for.

第三点可能是你在寻找什么。

Project Site here: http://www.ikvm.net/

项目现场:http://www.ikvm.net/

#1


1  

I looked into this a while back although I enver got far with it as the requirements changed. But I did read that using JNI, Java Native Interface may be able to help you with what you are needing to do.

我一会儿看了这个,虽然随着要求的改变,我已经很顺利了。但我确实读到了使用JNI,Java Native Interface可能能够帮助您完成您需要做的事情。

http://java.sun.com/developer/onlineTraining/Programming/JDCBook/jni.html

Hope this helps!

希望这可以帮助!

#2


2  

IKVM.NET is an implementation of Java for Mono and the Microsoft .NET Framework. It includes the following components:

IKVM.NET是Mono和Microsoft .NET Framework的Java实现。它包括以下组件:

  • A Java Virtual Machine implemented in .NET
  • 用.NET实现的Java虚拟机

  • A .NET implementation of the Java class libraries
  • Java类库的.NET实现

  • Tools that enable Java and .NET interoperability
  • 支持Java和.NET互操作性的工具

The third point is maybe what you are looking for.

第三点可能是你在寻找什么。

Project Site here: http://www.ikvm.net/

项目现场:http://www.ikvm.net/