快捷方式 URL 的 Windows 快捷方式 (.lnk .url) 解析器
我一直在使用此解决方案来解析Windows快捷方式并确定快捷方式指向的内容。但是,它仅适用于本地文件和网络共享。 Windows 快捷方式也可以指向 URL。我一直使用的解决方案无法正确解析 URL 快捷方式。知道为什么或如何解决它吗?
对我来说,它在这一行抛出 ArrayIndexOutOfBoundsException:
int file_location_info_flag = link[file_start + file_location_info_flag_offset_offset];
我一直在使用名为“C:\googleshort.url”的快捷方式进行测试,该快捷方式指向 http://www.google.com/。单击快捷方式效果很好并会显示 google,但 java 解析器失败。
I've been using this solution to parse a windows shortcut and determine what the shortcut points to. However, it only works for local files and network shares.
Windows shortcuts can also point to URLs. The solution I've been using does not parse URL shortcuts correctly. Any idea why or how to fix it?
For me, it throws an ArrayIndexOutOfBoundsException at this line:
int file_location_info_flag = link[file_start + file_location_info_flag_offset_offset];
I've been testing with a shortcut named "C:\googleshort.url" that points to http://www.google.com/. Clicking on the shortcut works just fine and brings up google, but the java parser fails.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
如果您在文本编辑器中打开 .url 文件,它将包含以下内容:
应该足够容易解析。
If you open the .url file in a text editor it has the following content:
Should be easy enough to parse.