1. <i id='4wzEq'><tr id='4wzEq'><dt id='4wzEq'><q id='4wzEq'><span id='4wzEq'><b id='4wzEq'><form id='4wzEq'><ins id='4wzEq'></ins><ul id='4wzEq'></ul><sub id='4wzEq'></sub></form><legend id='4wzEq'></legend><bdo id='4wzEq'><pre id='4wzEq'><center id='4wzEq'></center></pre></bdo></b><th id='4wzEq'></th></span></q></dt></tr></i><div id='4wzEq'><tfoot id='4wzEq'></tfoot><dl id='4wzEq'><fieldset id='4wzEq'></fieldset></dl></div>

      <legend id='4wzEq'><style id='4wzEq'><dir id='4wzEq'><q id='4wzEq'></q></dir></style></legend>

        <tfoot id='4wzEq'></tfoot>

        <small id='4wzEq'></small><noframes id='4wzEq'>

          <bdo id='4wzEq'></bdo><ul id='4wzEq'></ul>

        在 Windows 10 中将应用程序注册到 URI 方案

        时间:2023-09-15
            <tbody id='L9H71'></tbody>

          <legend id='L9H71'><style id='L9H71'><dir id='L9H71'><q id='L9H71'></q></dir></style></legend>
            • <bdo id='L9H71'></bdo><ul id='L9H71'></ul>

              <small id='L9H71'></small><noframes id='L9H71'>

              <i id='L9H71'><tr id='L9H71'><dt id='L9H71'><q id='L9H71'><span id='L9H71'><b id='L9H71'><form id='L9H71'><ins id='L9H71'></ins><ul id='L9H71'></ul><sub id='L9H71'></sub></form><legend id='L9H71'></legend><bdo id='L9H71'><pre id='L9H71'><center id='L9H71'></center></pre></bdo></b><th id='L9H71'></th></span></q></dt></tr></i><div id='L9H71'><tfoot id='L9H71'></tfoot><dl id='L9H71'><fieldset id='L9H71'></fieldset></dl></div>

                • <tfoot id='L9H71'></tfoot>
                  本文介绍了在 Windows 10 中将应用程序注册到 URI 方案的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                  问题描述

                  几年前,我开发了一个 Silverlight 组件,从 ASP.net Web 应用程序中调用,它使用 PInvoke 访问客户端计算机上的 USB(串行 COM 端口),以允许向某些扫描仪硬件发送命令.

                  随着 Windows 10 的出现和 Silverlight 的不可避免的消亡,我正在寻找访问客户端 PC 上硬件的替代方法(这是所有 Intranet Web 应用程序的东西,我们对实现有很大的控制权)

                  目前,我正在根据此页面查看将应用程序注册到 URI 方案(简单解决方案):

                  然后它会询问您是否要从浏览器中打开您的应用程序,单击确定.嘿 Presto,您的应用程序从浏览器打开,您现在可以将特定链接放入您的网页以从浏览器打开您的应用程序.此页面还记录了如何将参数传递给您的程序.

                  A few years back I developed a Silverlight Component called from within an ASP.net web app, that uses PInvoke to access a USB (Serial COM port) on the client machine to allow for sending commands to some scanner hardware.

                  With the advent of Windows 10 and the inevitable demise of Silverlight I am looking for alternatives to accessing hardware on the client PC (This is all Intranet Web Application stuff where we have a lot of control over the implementation)

                  Currently I am looking at Registering an Application to a URI Scheme (Easy solution) as per this page:https://msdn.microsoft.com/library/aa767914(v=vs.85).aspx OR alternatively maybe Javascript navigator.msLaunchUri (This seems to not be supported in Windows 7, which we need to still support) Refer: https://connect.microsoft.com/IE/feedback/details/864863/documented-api-function-navigator-mslaunchuri-not-present-in-windows-7

                  The Registering of an Application to a URI Scheme works fine in Windows 7/8/8.1 but seems to have changed in Windows 10 - Does anyone know how I can implement this (Through C# code, registry, something) to allow this to work in Windows 10

                  解决方案

                  I recently wanted to just this as well - and I found the answer so i'm posting it here for future reference and I couldn't find a working example in C# anywhere.

                  First of all your app needs requireAdministrator permissions. To do this, right click on the project in the Solution Explorer and click Add New Item, then select General and finally Application Manifest file if you don't already have one. In there, change the requestedExecutionLevel to requireAdministrator. Save.

                  I this is the first time you've done this, you'll need to restart Visual Studio as it probably isnt running under Admin privaleges.

                  Okay, so I wanted my app to create the registry key when it starts up, so in the constructor for my form I put in the following code, which creates the URL Protocol foo:// for a program called 'oggsplit.exe' (which I happened to have in my C: root so I just used that for testing)

                  RegistryKey key;
                  key = Registry.ClassesRoot.CreateSubKey("foo");
                  key.SetValue("", "URL: Foo Protocol");
                  key.SetValue("URL Protocol","");
                  
                  key = key.CreateSubKey("shell");
                  key = key.CreateSubKey("open");
                  key = key.CreateSubKey("command");
                  key.SetValue("", "C:\oggsplit.exe");
                  

                  Once you've configured that, save and run the program. You'll get no feedback, and as long as you don't see any errors it should have worked correctly. Now, open your browser (no need to restart or anything) and go to the address foo://hello. This is what it looks like for me in Google Chrome:

                  It will then ask you if you want to open your application from the browser, click okay. Hey Presto, your app opens from the browser, you can now put a specilised link into your web page to open your app from the browser. This Page also documents how to pass arguments through to your program as well.

                  这篇关于在 Windows 10 中将应用程序注册到 URI 方案的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                  上一篇:如何更改 UWP 中选定 ListView 项的突出显示颜色(Windows 10) 下一篇:使用 DoubleBuffering 和 FormBorderStyle.None 在 Windows10 上重绘问题

                  相关文章

                    <bdo id='no7Gl'></bdo><ul id='no7Gl'></ul>

                  1. <legend id='no7Gl'><style id='no7Gl'><dir id='no7Gl'><q id='no7Gl'></q></dir></style></legend>

                    <i id='no7Gl'><tr id='no7Gl'><dt id='no7Gl'><q id='no7Gl'><span id='no7Gl'><b id='no7Gl'><form id='no7Gl'><ins id='no7Gl'></ins><ul id='no7Gl'></ul><sub id='no7Gl'></sub></form><legend id='no7Gl'></legend><bdo id='no7Gl'><pre id='no7Gl'><center id='no7Gl'></center></pre></bdo></b><th id='no7Gl'></th></span></q></dt></tr></i><div id='no7Gl'><tfoot id='no7Gl'></tfoot><dl id='no7Gl'><fieldset id='no7Gl'></fieldset></dl></div>
                    1. <tfoot id='no7Gl'></tfoot>

                      <small id='no7Gl'></small><noframes id='no7Gl'>