Common Web page Invoke native application scenario (Windows platform)

Source: Internet
Author: User

First, update the registration form
Windows Registry Editor Version 5.00[hkey_classes_root\receiveoutofarg] "URL Protocol" = "d:\\longhaibin\\learn\\net\\ Receiveoutofarg\\receiveoutofarg\\bin\\debug\\receiveoutofarg.exe "@=" ApplicationName "[HKEY_CLASSES_ROOT\ Receiveoutofarg\defaulticon]@= "d:\\longhaibin\\learn\\net\\receiveoutofarg\\receiveoutofarg\\bin\\debug\\ receiveoutofarg.exe,1 "[hkey_classes_root\receiveoutofarg\shell][hkey_classes_root\receiveoutofarg\shell\open][ Hkey_classes_root\receiveoutofarg13:14 2017/5/11\shell\open\command]@= "\" d:\\longhaibin\\learn\\net\\ Receiveoutofarg\\receiveoutofarg\\bin\\debug\\receiveoutofarg.exe\ "\"%1\ ""

Description

    • ApplicationName: Indicates the name of the prompt when the Web page opens
    • '%1 ': represents the parameter to be passed, just%1,\ ": Represents an escape character
Second, create an application

Here's the code for the C # application: Entry location:

Static class program{    //<summary>///      The main entry point of the application.     /// </summary>     [STAThread]    staticvoid Main (string[] args)    {        application.enablevisualstyles ();        Application.setcompatibletextrenderingdefault (false);        Application.Run (new  Form1 (args));}    }

Form code:

 Public Partial classform1:form{Private string[] args;  PublicForm1 (string[] args) {         This. args =args;    InitializeComponent (); }    Private voidForm1_Load (Objectsender, EventArgs e) {         This. Label1. Text =string. Join (",", This. args); }}
Third, create a Web page

Web pages can be called with a tag:

<href= "RECEIVEOUTOFARG://ABC">open</A  >

Common Web page Invoke native application scenario (Windows platform)

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.