我一直在使用这个解决schemeparsing一个Windows快捷方式,并确定快捷方式指向什么。 但是,它只适用于本地文件和networking共享。 Windows快捷方式也可以指向URL。 我一直使用的解决scheme不能正确parsingURL快捷方式。 任何想法为什么或如何解决它?
对我来说,它会在这一行抛出一个ArrayIndexOutOfBoundsException:
int file_location_info_flag = link[file_start + file_location_info_flag_offset_offset];
我一直在testing一个名为“C:\ googleshort.url”的快捷方式,指向http://www.google.com/ 。 点击快捷方式工作得很好,并提出了谷歌,但Javaparsing器失败。
如果您在文本编辑器中打开.url文件,它具有以下内容:
[InternetShortcut] URL=http://stackoverflow.com/questions/4974151/windows-shortcut-lnk-url-parser-for-shortcut-urls
应该很容易解析。