How do I distribute controls in the web application?

xiaoxiao2021-03-06  55

● How do I distribute controls in the web application? ● How to make my control respond to the mouse click? ● Can Active Server Pages (ASP) use controls? ● How to use the TREND control in the web page?

How do I distribute controls in the web application? We offer the following information for users who want to use controls in the web application. This is the documentation of the real extracted documentation from the Microsoft's Development Tool (MSDN) book. The files referenced in many places may be already old, please pay attention to the changes in these places. Note: All Century Flying Corporation has been named "Safe For Download" by a digital signature name. Microsoft Developer Network

When using your component on a Web page, there are additional considerations. The .ocx file and all supporting files must be on the target machine or downloaded across the Internet. This makes code size and download time an important consideration. Downloads can be packaged in A Signed .cab file.

Packaging code for Downloading

The codebase tag

ActiveX components are embedded in Web pages using the tag. The CODEBASE parameter of the tag specifies the location from which to download the component. CODEBASE can point at a number of different file types successfully.

Using the codebase tag with an ocx file

CODEBASE = "http://www.mysite.com/mycontrol.ocx#version=3,6,0,0" This solution downloads only the component's .ocx file and requires any supporting DLLs to already be installed on the client machine.

Using the codebase tag with an inf file

Codebase = "http://www.mysite.com/trustme.inf"

An .inf File Will Control The Installation of An .ocx File and ITS Supporting Files. This Method Is Not Recommended Because IT IS NOT (See Signing Code for Pointers On Code Signing).

Using the codebase tag with a capacity

Codebase = "http://www.somesite.com/acontrol.cab#version=1, 2, 0, 0"

Cabinet files are the recommended way to package ActiveX components in a cabinet file allows an .inf file to be included to component installation of the ActiveX component and any dependent DLLs. Using a CAB file automatically compresses the code for quicker download. If you are using a .cab file for component down, it is faster to sign the entire .cab file tour in Individual Component.creating Cab Files

The Cabinet Development Kit Can Be Obtained from The Microsoft Developers' Web Site, http://www.microsoft.com/workshop/. In this Kit, You Will Find The Necessary Tools To Construct Cabinet Files.

The cabinet file pointed to by CODEBASE should contain the .ocx file for your ActiveX component and an .inf file to control its installation. You create the cabinet file by specifying the name of your control file and an .inf file. Do not include dependent Dlls That May Already Exist On The System in this Cabinet file.

THE INF FILE

The following example, trend.inf, lists the supporting files and the version information needed for the VB TREND component. Notice the location for the VB DLLs is a Microsoft Web site. The * .cab is provided and signed by Microsoft.Contents of trend .inf: [TREND.OCX] file-win32-x86 = thiscabRegisterServer = yesDestDir = FileVersion = 3,5,0,0 [ASYCFILT.DLL] hook = AsycFilt.cab_InstallerFileVersion = 2,20,4118,1 [AsycFilt.cab_Installer] file-win32-x86 = http: //activex.microsoft.com/controls/vb5/AsycFilt.cabInfFile=AsycFilt.inf [MSVBVM50.DLL] hook = MSVBVM50.cab_InstallerFileVersion = 5,2,82,44 [MSVBVM50.cab_Installer] file-win32-x86 = http: //activex.microsoft.com/controls/vb5/MSVBVM50.cabInfFile=MSVBVM50.inf [Setup Hooks] AddToRegHook = AddToRegHook [AddToRegHook] InfSection = DefaultInstall [DefaultInstall] AddReg = AddToRegistry [AddToRegistry] / // hklm, "Software / Classes / CLSID / {9687C44A-906A-11D4-987D-Da7EAAB63647} / Implement Categories / {7DD95801-9882-11CF-9FA9-00AA 006C42C4} "HKLM," SOFTWARE / Classes / CLSID / {9687C44A-906A-11D4-987D-DA7EAAB63647} / Implemented Categories / {7DD95802-9882-11CF-9FA9-00AA006C42C4} "The TagThe following example illustrates using the < Object> tag to package the vb trend component. <

Param name = "gridStyle" value = "1"> in this case, trend.cab Will Contain Two files, trend.ocx and trend.inf. The folload: c: c: c: c: c: c: c: c: c: / capDevkit / Cabarc.exe -s 6144 n Trend.cab Trend.ocx Trend.infthe -s 6144 Parameter Reserves SPACE IN The Cabinet for Code Signing.

The Version Tag Note here that the #Version information specified with a CAB file applies to the component specified by the CLASSID parameter of the tag. Depending on the version specified, you can force download of your component. For complete specifications of the OBJECT tag including the CODEBASE parameter, see the W3C reference. Licensing Issues If you want to use a licensed component on a Web page, you must verify that the license agreement allows its use on the Internet and create a license package file (LPK) for it. A licensed ActiveX component will not load properly in an HTML page if the computer running Internet Explorer is not licensed to use the component. For example, if a licensed component was built using Visual Basic, the HTML page using the component will load properly ON The Computer WHERE The Component Was Built, But It Will NOT LOAD IN A DIFFERENT COMPUTER UNSUDETINGENSING INSE A LICENSED ACTIVEX Component in Internet Explorer, YO u must check the vendor's license agreement to verify that the license for the component permits: ● Redistribution ● Use of the component on the Internet ● Use of the Codebase parameter To use a licensed component in an HTML page on a non-licensed machine, you must generate a license package file (LPK). The LPK file contains run-time licenses for licensed components in the HTML page. file is generated via This LPKtool.zip which comes with the ActiveX Software Development Kit (SDK). You can download the ActiveX SDK THROUGH THE Microsoft Web Site http://www.microsoft.com/activex. To create an lpk file ●

Run LPKTOOL.EXE ON A Computer That IS licensed to use the component.

In The License Package Authoring Tool Dialog Box, In The Available Controls List Box, Select Each Licensed ActiveX Component That Will Be Used on The Html Page and Click Add. ●

Click Save & Exit and Type a name for the LPK File. This Will Create The LPK File and Close The Application.

To Embed a licensed Component on an HTML Page

Edit your HTML page. In the HTML page, insert an tag for the License Manager object before any other tags. The License Manager is an ActiveX component that is installed with Internet Explorer. Its class ID is shown below. . Set the LPKPath property of the License Manager object to the path and name of the LPK file You can have only one LPK file per HTML page .

Insert the tag for your licensed component after the License Manager tag. For example, an HTML page that displays the Microsoft Masked Edit component is shown below. The first class ID is for the License Manager component, the second class ID is for .

. Insert the attribute for your LPK file, if using the NCompass ActiveX plug-in If your component may be viewed on other ActiveX enabled browsers - for example Netscape using the NCompass ActiveX plug-in - you must add the SYNTAX As Shown Below.

Signing code code signing is designed to identify the source of code and to guarantee that the code has not changed since it was signed. Depending on browser safety settings, users may be warned before the code is downloaded. Users may choose to trust certain certificate owners or companies, in which case, code signed by those trusted will be downloaded without warning. code is digitally signed to avoid tampering. Make sure your final code is signed so that your component can be automatically downloaded without displaying trust warning messages. For details on how to sign code, check the documentation on Authenticode? in the ActiveX SDK. For more information on the Microsoft code-signing initiative, check. Depending on trust and browser safety level settings, a certificate may be Displayed to Identify the Sig ning person or company. If the safety level is none, or if the signed component's certificate owner is trusted, a certificate will not be displayed. See Safety Levels and Control Behavior for details on how the browser safety setting will determine whether your component is downloaded And a certificate displayed. Digital Signing Guarantees Code Has Not Changd Since IT '

s been signed. A hash of the code is taken and embedded in the certificate. This hash is later compared with a hash of the code taken after the code is downloaded but before it runs. Companies such as Verisign can supply private and public keys needed to sign code. The ActiveX SDK ships with MakeCert, a utility for creating test certificates, and two registry files, wvtston.reg and wvtstoff.reg, for specifying whether or not the browser should recognize test certificates as valid. Internet Explorer Browser Safety Levels and Control Behavior A browser has options for safety level, configurable by the user. Because Web pages can contain active content that might potentially harm a user's computer, browsers allow the user to select options for safety level. Depending on the way a browser implements safety Levels, a Component May Not Be Downloaded At All, or Will Display a Certificate OR WARNING Message TO Allow The User To Choose At Run Time WHETER OR NOT To Download The Component. The behavior of ActiveX components under high, medium, and low safety levels on Internet Explorer is listed below. High Safety Mode ● Unsigned components will not be downloaded. ● Signed components will display a certificate if untrusted (a user can choose an option to always trust code from this certificate owner from now on). ● Only components marked as safe will have persistent data and / or be scriptable. Medium Safety Mode ● Unsigned components will display a warning before downloading. ● Signed components will display a certificate if untrusted. ● Components Not Marked AS Safe Will Display A Warning.low Safety Mode ● Components Are Downloaded WITHOUT WARNING. ● Scripting and personistence occur without warning.

转载请注明原文地址:https://www.9cbs.com/read-115065.html

New Post(0)
CopyRight © 2020 All Rights Reserved
Processed: 0.051, SQL: 9