如何从 Java 使用 WinInet API?

发布于 2024-10-05 01:53:08 字数 390 浏览 1 评论 0原文

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.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(4

苍景流年 2024-10-12 01:53:08

总会有 JNI 和 JNA,但如果您还不了解 C 或 C++,则会涉及到学习曲线,尤其是 JNI:JNI 参考JNA 站点

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

乖乖 2024-10-12 01:53:08

在过去的几个月里,我不得不将一些 C、C++ 和 Win32 替代方案与我的 Java 项目混合以进行本机访问。经过与 JNA 的大量合作以及最近与 JInvoke 的集成,我可以告诉您 JInvoke 比 JNA 成熟一点。即使JInvoke比JNA更老,我发现它的语法更简洁。对于那些喜欢 JNA 的人来说很抱歉,但是使用 JInvoke 我可以从 Java 中挂钩 Windows api。

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.

初见 2024-10-12 01:53:08

我看到有一个名为 JInvoke 的商业库:

使Java开发人员能够轻松地
调用本机方法(例如
Win32 API 或基于 C 的 Windows DLL 和
Unix动态库)与纯Java
代码。

不过,我更喜欢免费的、专门针对 WinInet 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.

温折酒 2024-10-12 01:53:08

看看 JACOB 项目

JACOB 是一个 JAVA-COM 桥,允许
您调用 COM 自动化组件
来自爪哇。它使用 JNI 来制作本机
对 COM 库的调用。雅各布跑动
在 x86 和 x64 环境上支持
32 位和 64 位 JVM

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

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/

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文