开发者

How to use the WinInet API from Java?

According to this answer to an earlier question of mine, the WinInet Windows API is the correct way to read and write 开发者_运维问答internet connection settings in Windows. How can I use this API from Java? I'd prefer a free, open-source solution.


There's always JNI and JNA, but if you don't already know C or C++ there'll be a learning curve involved, especially with JNI: JNI Reference, JNA Site


Over the last months I had to mix with my Java project some C, C++ and Win32 alternatives for native access. After a lot work with JNA and recently with JInvoke for such integration, I can tell you that JInvoke is a little mature than JNA. Even JInvoke be older than JNA, I found its syntax more concise and simple. Sorry for those who loves JNA but using JInvoke I could literally hook the windows api from Java.


I see there's a commercial library called JInvoke that:

enables Java developers to easily invoke native methods (such as the Win32 API or C-based Windows DLLs and Unix dynamic libraries) with pure Java code.

However I'd prefer something free and specifically targetted at the WinInet API.


Have a look at JACOB project

JACOB is a JAVA-COM Bridge that allows you to call COM Automation components from Java. It uses JNI to make native calls to the COM libraries. JACOB runs on x86 and x64 environments supporting 32 bit and 64 bit JVMs

http://sourceforge.net/projects/jacob-project/

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜