Paip. Script components for improving ASP programming Security

Source: Internet
Author: User

Paip. Script components for improving ASP programming Security

In the past, for Script Security, you can use VB and VC to write COM components .. Here, a new technology is available, that is, scripts.

Component, simply put, a script can also be used to write COM components ..

 

Script parts provide you with a convenient way to create COM parts using the scripting language (VBScript) and JScript.

Script parts can be used as com parts for applications, and any other applications that support com parts. Listed below

The content to be discussed in this tutorial.

The Windows Script part technology includes the following parts:

The Program (scrobj. dll) used to send com requests to the script part during running of the script part. According to the com terminology,

Scrobj. dll is executed as the inproc server of the script component.

 

Script part file (this is A. WSC file ). The script part file is an XML (Extensible Markup Language) file, where the package

Contains information about the com part type to be created (that is, the interface handler to be used ). Then, according to the processing program

Provides available functions. You can write scripts in the script parts to implement these interfaces.
When the script component is running, the program can be used as an entry to the Host application.

You can use Remote COM component technology, DCOM, and remote rpc call .. Strong.

 

Create an ASP script part. You only need to create a script part according to the content described in the script part file. Use

<Implements> element to implement the ASP interface handler, that is, set the type attribute of the <implements> element

"Asp ". This provides access to ASP objects (response, request, server, session, and

Application. In the ASP script part, these objects can be used as directly on the ASP page.

----------------- Script component call :------------------
<% Set wscasp = Createobject ("aspscriptlet") %>
<P> the current date is <% = wscasp. adddate () %> </P>

Among them, aspscriptlet is the self-built COM component ..

The source code of the COM component is as follows:

<Component id = "aspscriptlet">
<Registration progid = "aspscriptlet"/>

<Public>
<Property name = "applicationvar1"/>
<Method name = "adddate"/>
</Public>

<Implements type = "asp"/>
<Script language = "VBScript">
<! [CDATA [
Dim applicationvar1
Applicationvar1 = Application ("var1 ")
Sub adddate ()
Response. Write (date)
End sub
]>
</SCRIPT>
</Component>

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.