How to use the WinInet API from Java?

2019-07-11 02:34发布

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.

4条回答
淡お忘
2楼-- · 2019-07-11 03:13

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

查看更多
戒情不戒烟
3楼-- · 2019-07-11 03:18

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/

查看更多
我想做一个坏孩纸
4楼-- · 2019-07-11 03:25

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.

查看更多
We Are One
5楼-- · 2019-07-11 03:27

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.

查看更多
登录 后发表回答