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 回答
在过去的几个月里,我不得不将一些 C、C++ 和 Win32 替代方案与我的 Java 项目混合用于本地访问。经过与 JNA 以及最近与 JInvoke 进行此类集成的大量工作后,我可以告诉您 JInvoke 比 JNA 稍微成熟一些。即使 JInvoke 比 JNA 更老,我发现它的语法更简洁。对于那些喜欢 JNA 但使用 JInvoke 的人来说抱歉,我可以从 Java 中直接挂钩 windows api。
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.
看看 JACOB 项目
JACOB 是一个 JAVA-COM 桥接器,它允许您从 Java 调用 COM 自动化组件。它使用 JNI 对 COM 库进行本机调用。JACOB 在支持 32 位和 64 位 JVM 的 x86 和 x64 环境中运行