2011-02-11 127 views
2

我一直在使用this solution來解析窗口快捷方式並確定快捷方式指向的內容。但是,它只適用於本地文件和網絡共享。 Windows快捷方式也可以指向URL。我一直使用的解決方案不能正確解析URL快捷方式。任何想法,爲什麼或如何解決呢?快捷方式URL的快捷方式(.lnk .url)解析器

對於我來說,它拋出一個ArrayIndexOutOfBoundsException在這一行:指向http://www.google.com/

int file_location_info_flag = link[file_start + file_location_info_flag_offset_offset]; 

我已經有名爲 「\ googleshort.url C」 快捷方式測試。點擊快捷方式工作得很好,帶來了谷歌,但Java解析器失敗。

回答

4

如果你在一個文本編輯器打開的.url文件,它具有以下內容:

[InternetShortcut] 
URL=http://stackoverflow.com/questions/4974151/windows-shortcut-lnk-url-parser-for-shortcut-urls 

應該很容易解析。