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\""
注册目录名必须是 协议名!