java - 如何通过在 Java 中调用 Windows API 来打开 DVD 驱动器?
问题描述
如何在 Java 中使用 Windows API 函数?我正在寻找一个参考来指导我在 Windows 上的 Java 应用程序中使用 Windows API。
例如,我想在我的 Java 应用程序中控制 DVD 驱动器。我该怎么做呢?
任何帮助表示赞赏。
解决方案
You can do this by using either JNA (Java Native Access) or JNI (Java Native Interface).
With JNA you can use com.sun.jna.platform.win32.Kernel32
to call DeviceIoControl
, which will allow you to control your DVD drive.
推荐阅读
- mysql - 在 JPA 标准查询中对 LocalDate 使用 TIMESTAMPDIFF 函数
- html - 在 onclick 按钮后,列宽更改/缩小以容纳另一列 - 反应
- python - 在 Visual Studio Code 中使用 rasterio (python) -“文件系统中不存在,并且不被识别为支持的数据集名称。”
- python - 根据多个值过滤 2D numpy 行
- npm - 有人可以帮我解决这个问题吗?致命错误:无法找到本地咕噜声
- php - php在尝试调用方法后输出代码
- javascript - 等待在嵌套的 for...of 循环中不起作用 - typeorm - nodejs
- r - 是否有一个 R 函数来过滤变量中的任何字符串?
- r - 按 R 中的顺序数据分组
- r - 查找重复值无法正常工作