Call local software through a link on the web page

Source: Internet
Author: User
The user puts forward a requirement that the locally installed C/S structure software should be called out. Note: instead of clicking its shortcut or exe file, you need to call the software client by clicking a button or link on the webpage. I have found relevant information on the Internet. There are two common solutions... SyntaxHighlighter. all ();

The user puts forward a requirement that the locally installed C/S structure software should be called out.

Note: instead of clicking its shortcut or exe file, you need to call the software client by clicking a button or link on the webpage. I have found related information on the Internet and have two common solutions.

1. Use js Code for debugging. The Code is as follows:

[Javascript]
Function Run (strPath ){
Var objShell = new ActiveXObject ("wscript. shell ");
ObjShell. Run (strPath );
ObjShell = null;
}
 
Call QQ Program
In this way, ActiveX script programs are used to control program calls. However, there is a security issue. You need to adjust the security level of the browser. In addition, you need to restrict the installation path of local software, which brings great trouble to the customer. If the customer's software is not installed in D:/Program % 20 Files/QQ path, the path cannot be found, which lacks flexibility and is not desirable.
2. Use a java program to write a panel, but it is difficult and the user experience is not good. The basic code is as follows:

[Java]
Public static void main (String [] args) throws Exception {
Process p = runtime.getruntime(cmd.exe c (
"\" C:/program files/http://dev.21tx.com/ OS /windows/ "target =" _ blank "> Windows/notepad.exe \"");
P. waitFor ();
}
}

In this way, you can call the local bat program or exe program, which is also a security problem and path problem. There may be stability problems, and this method is not available.
In the end, it was achieved by a widget of longtu software company. The steps are as follows:

1. Install the control.

2, plusThe Code is as follows:

[Java]
Classid = "clsid: A3E8EEE9-E85E-472A-AEB3-EB182A605C62"
Codebase = "/$ {res}/ocx/AppCallerXControl. ocx # version ="
Width = "0"
Height = "0"
Visible = "0"
Id = "AppCaller"
>

 

/$ {Res}/ocx/AppCallerXControl. ocx indicates the control path, id indicates the control object, and you can call methods in the control class.
[Java]

Related Article

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.