代码实现==》 <html> <head> <script language="javascript"> function Run(strPath) { var objShell = new ActiveXObject("wscript.shell"); objShell.exec(strPath); objShell = null; } </script> </head> <body> 请输入要运行的程序路径:<br> <input name=exe type=text size=20 value= "E:\DCWeb\PrinterBarcode\PrinterBarcode\PrinterBarcode\bin\Debug\PrinterBarcode.exe""%1";> <BUTTON class=button onclick="Run(exe.value)">确定</BUTTON> </body> </html>
reg_test.reg文件==》
Windows Registry Editor Version 5.00 [HKEY_CLASSES_ROOTHelloWorld] @="HelloWorld Protocol" "URL Protocol"="" [HKEY_CLASSES_ROOTHelloWorldDefaultIcon] @="E:\HW_TEST\HelloWorld.exe,1" [HKEY_CLASSES_ROOTHelloWorldshell] @="" [HKEY_CLASSES_ROOTHelloWorldshellopen] @="" [HKEY_CLASSES_ROOTHelloWorldshellopencommand] @=""E:\HW_TEST\HelloWorld.exe" "%1""
注意:E:\DCWeb\PrinterBarcode\PrinterBarcode\PrinterBarcode\bin\Debug\PrinterBarcode.exe——需要启动的程序
运行方式:helloworld://hello_world/Apara=abc&Bpara=001
实例下载地址:http://download.csdn.net/detail/u010713920/9643071