實現瀏覽器中點擊鏈接啓動本地程序 XXX:// 參數

xgnote:// r:/2.txt     --這種不會打開

xgnote:// r:\2.txt    後一段用\就能打開.

要實現瀏覽器訪問本地程序,需要在註冊表 HKEY_CLASSES_ROOT\ 位置建個協議目錄,內容如下:

Windows Registry Editor Version 5.00

[HKEY_CLASSES_ROOT\xgnote]
"URL Protocol"="D:\\Program Files (x86)\\Notepad++\\notepad++.exe"
@="notepad++"

[HKEY_CLASSES_ROOT\xgnote\DefaultIcon]
@="D:\\Program Files (x86)\\Notepad++\\notepad++.exe,0"

[HKEY_CLASSES_ROOT\xgnote\Shell]
@=""

[HKEY_CLASSES_ROOT\xgnote\Shell\open]
@=""

[HKEY_CLASSES_ROOT\xgnote\Shell\open\command]
@="\"D:\\Program Files (x86)\\Notepad++\\notepad++.exe\" \"%1\""

 

註冊目錄名必須是 協議名!

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章