× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.



vhamberg@xxxxxxxxxxx skrev den 13-08-2008 18:52:
Cool! Yeah, DLL just means dynamic link library, after all.

I just looked at the IKVM site - Richard, my boss, does all the .Net, so I hear about it - have not had time to actually use it - have done quite a bit of pre-.Net VB development.

So the site said that you can create a DLL from a JAR file - and that DLL is what you can use in .Net. Therefore, you can take jt400.jar and make a DLL from it that is usable in .Net - and since anyone can use ikvmc to do it, seems there is no need to publish it.
Got it working with Visual Studio C# Express.

Download ikvm. Run "ikvmc -target:library ....pathtojt400.jar". It generates jt400.dll

Open Visual Studio C# Express, create a console application project, right click on project node and add references to jt400.dll and (bummer) IKVM.OpenJDK.ClassLibrary.dll. Then the following code runs:

===
using System;
using System.Collections.Generic;
using System.Text;
using com.ibm.as400.access;

namespace ConsoleApplication1
{
class Program
{
static void Main(string[] args)
{
com.ibm.as400.access.AS400 as400 = new com.ibm.as400.access.AS400("system", "user", "password");
IFSFile ifs = new com.ibm.as400.access.IFSFile(as400, "/");
foreach (String s in ifs.list()) {
Console.Out.WriteLine(s);
};
as400.disconnectAllServices();
Console.Out.WriteLine("Done");

}
}
}
===

I am a newbie both with the program and the language so feel free to suggest improvements.

The major impediment between this and the same solution in plain java is the extra baggage of the 25 Mb IKVM...dll file. Oh well :)


As an Amazon Associate we earn from qualifying purchases.

This thread ...

Follow-Ups:
Replies:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.