IE calls the client program instance

Source: Internet
Author: User

See how the msdn http://msdn.microsoft.com/en-us/library/aa767914.aspx works forProgramRegister a URL protocol
CoreCodeIs the Registry

Windows Registry Editor Version 5.00

[Hkey_classes_root \ alert]
@ = "Alterprotocol"
"URL protocol" = "C: \ alert.exe"

[Hkey_classes_root \ alert \ defaulticon]
@ = "C: \ alert.exe, 1"

[Hkey_classes_root \ alert \ shell]

[Hkey_classes_root \ alert \ shell \ open]

[Hkey_classes_root \ alert \ shell \ open \ command]
@ = "\" C: \ alert.exe \ "\" % 1 \""

Now we have registered an alert protocol for alert.exe. Enter alert: // hello in the IE address bar to start the alert.exe program of the customer.

See alert.exe code first:

 Namespace Alert { Class Program { Static  String Processinput ( String S ){ // Todo verify and validate the input              // String as appropriate for your application.              Return S ;} Static   Void Main ( String [] ARGs) {console. writeline ( "Client program call" ); Console. writeline ( "Alert.exe parameters: \ r \ n" ); Console. writeline ( "Raw command-line: \ n \ t" + Environment. CommandLine); console. writeline ("\ N parameter: \ n" ); Foreach ( String S In ARGs) {console. writeline ( "\ T" + Processinput (s);} console. readkey ();}}}

If you enable the 360 web page firewall: The first time you run the firewall, the following prompt appears:

Allow.
If your C drive does not have alert.exe:

Running effect:

Attachment download: alert.rar

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.