Add a registry "class design" to the website

zhaozj2021-02-16  102

When doing a website, many times to save some of the information outside the web page, edit this information online, to reach the effect of updating the content of the web page. For this case, we used to handle it using a database or text file.

Ways to save web information using text files, is the most original method, which is quite inconvenient, and is more difficult to search for information, moreover, not to use a unified way to handle different web information.

It is a relatively common way to use a database method to save web information. It is relatively convenient to use, and it is convenient to retrieve information. The inconvenient place is that every call needs to open a database link, a considerable consumption server resource. Moreover, the preservation and organization of information is still lack in flexibility.

To this end, I imitate the way of registry in WINDOWS, combined with XML and ASP technology, add a dedicated "Registry" class to the website.

This class will implement the following features:

The storage location and information encoding registry of the registry can be set by the "Column-Project-Project-Key-Value" hierarchical format. For the registry with "initialization" features for the feature, "Create", "Delete", "Enumerated". For the project, "Create", "Delete", "Enumeration", "Clear". The function of "Creating", "Delete", "Enumerated", "Clear" is "created", "delete", "Clear". For key values, "Settings", "Read", "enumerated" feature.

Thus, the structure of the class is:

Class RegistryObject

Path Encoding Initial Createchannel DeleteChannel GetAllChannel CreateSecion Deletection GetAllsections Clearllsections CreateKey Deletekey GetAllkeys Clearallkeys SaveValue ReadValue GetAllValues

In addition, the class of registryKey is used when enumerating all key values.

This class can be modified slightly, but can be used in the VB program, HTML client program.

Taken: http://dev.9cbs.net/Article/32/32032.shtm

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

New Post(0)