1. Use JavaScript to check whether an ActiveX control has been installed in the system.
- Try {
- VaR AX = new activexobject ("Control name ");
- Alert ("installed ");
- } Catch (e ){
- Alert ("not installed ");
- }
Release
1. Open cmd, enter C:/Windows/system32, and enter iexpress. Open the cab production tool
2. Click "Next" and select create compressed files only (ActiveX instils)
3. Click Add to add the generated setup. MSI and hello. INF. Next
4. Click Browse, select the storage path and file name of the generated cab file, and check the store files using long file name inside package. Next step
5. Select don't save. Click Finish. The cab file is generated.
6. Create a New hello.html file. The content is as follows:
<HTML>
<Head>
<Title> test </title>
</Head>
<Body>
<Object ID = "mycontrol" classid = "CLSID: 52a0874c-f75f-4abc-bd2c-6b300afc2e67" codebase = "Hello. Cab">
</Object>
<Input type = "button" onclick = "mycontrol. showmessage ()" value = "clickme" id = "button1"/>
</Body>
</Html>
8. Copy the HTML file and the cab file to the wwwroot/ActiveX/directory.
9. When you access the.../ActiveX/helloworld.html on another computer, the system will prompt that the control is not secure and windows will block installation. Solution: on the client browser, click "Tools> Internet Options> Security> Trusted Sites> sites ", deselect the preceding "server verification required for all sites in the region. Then add the server address to the trusted site. You can install this control.
Http://www.cnblogs.com/homer/archive/2005/01/04/86473.html-basics 1
Http://www.cnblogs.com/homer/archive/2005/01/08/88780.html-basics 2
Http://www.cnblogs.com/homer/archive/2005/01/26/97822.html-basics 3
Http://www.cnblogs.com/sgivee/archive/2011/08/10/2133500.html-basic integrated version and progid