我创建了一个应用程序来充当协议(protocol)处理程序,注册表是根据 http://msdn.microsoft.com/en-us/library/ie/aa767914(v=vs.85).aspx 设置的
然后在网页中我有类似的东西:
<a href="testapp:arg1">Test App</a>
如果我单击该链接,应用程序将启动,并且“testapp:arg1”作为参数传入。
现在我想将多个参数传递给处理程序。我猜在“命令”注册表项中,我会有 "path_to_exe""%1""%2"
。但是我不知道如何编写 html 链接以提供多个参数。
是否可以传递多个参数?如果是,我该怎么做?不同浏览器之间是否存在差异?
最佳答案
在Registering an Application to a URI Scheme , 它说
When a user clicks a link containing your custom URI scheme, Windows Internet Explorer launches the pluggable protocol handler registered for that URI scheme. If the specified open command specified in the registry contains a %1 parameter, Internet Explorer passes the URI to the registered pluggable protocol handler application.
这意味着,空格将作为整个 URI 中的字符处理。
关于html - 具有多个参数的协议(protocol)处理程序,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/24718450/