Use components to protect your ASP code

zhaozj2021-02-08  270

I used to talk about a lot of issues related to opening the database connection security. Now I will put forward a kind of ideas.

Use ActiveX DLL to protect your code. (You can don't need to worry about using shared encryption software,

More importantly, I can have my own way to dig, enjoy the feeling of "everything in master".

At the same time, in order to let everyone do their own components. )

ActiveX DLLS is a compiled machine code, and if there is no source project file, it is unable to be compiled.

This technology enables developers to develop public automation procedures and release them as a ShareWare version of the program.

This item can be seen in some components sold in ChinaASP.

If you want to protect some of the code in your ASP, for example, you don't want others to see what you are using.

Database, or don't want others to see how important functions are completed, or an important

Process (Cakk can be found), you can make your own components through constant development, this is a DLL file, that is, someone got it.

This DLL file, it will not be able to get important information you want to protect at all. And these components you have developed

Give your program brings a new source of origin.

Let's take a very commonly used, everyone cares about how to keep the process of opening the database.

The example is simple, it is to display the contents of a field in a database in a drop-down box.

The whole process is as follows:

1. Newly built a VB6 ActiveX DLL project

2. In the Properties window, name your library module and project file. In the example, the Keiths_lookup project name and the Lookup module name.

This written name is the DLL function name you will be referenced in the ASP (the object name in the ASP will be keiths_lookup.lookup).

3. Use the same name store (of course, the suffix is ​​not the same).

4. Select References from the project menu in VB6. Then select Microsoft ActiveX Data Objects 2.0 Library, Microsoft

ActiveX Data Objects Recordset 2.0 Library.

The code of the file is as follows:

Public Function HTML_COMBO (Comboname As String, Lookup_field As String) AS STRING

Dim outstring as string

DIM Conn as adodb.connection

DIM RST As Adodb.Recordset

DIM SQLSTRING AS STRING

SET CONN = CreateObject ("AdoDb.Connection")

Set Rst = CreateObject ("AdoDb.Recordset")

'The field name in these databases is just set for this example, you can modify the code according to your needs.

Sqlstring = "SELECT [Lookup_Description], [Lookup_Key] from _

[Lookup_table] where [look_field] = '"& lookup_field &"' "

'You can enter the username and password you connect to the database, and now you can see the ASP source code.

'He can't know what password you are using, huh, huh.

Conn.open "DSN = SUMNET; UID =; PWD = .;"

Rst.open Sqlstring, CONN, 3, 3

IF not rst.eof deathrst.movefirst

Outstring = "

CopyRight © 2020 All Rights Reserved
Processed: 0.060, SQL: 9