Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

Example Analysis of organizational structure of VB.NET Registry

2025-04-11 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

Shulou(Shulou.com)06/02 Report--

This article will explain in detail about the VB. NET registry organization structure of the sample analysis, Xiaobian feel quite practical, so share to you as a reference, I hope you can have some harvest after reading this article.

VB. NET Registry Organization

Before accessing the registry, you must first understand the organizational structure of the registry, and the easiest way to understand the organizational structure of the registry is to start the Registry Editor provided by Windows. The method to start is to click the Run command on the Start menu. After entering RegEdit, you can see the Registry Editor window.

VB. NET namespaces are simple and easy to learn

A brief introduction to VB. NET

Let you know the function of VB. NET pointer

About using VB. NET ANY Key Points Summary

VB. NET Pointer Application

Registry Editor is structured similarly to Explorer. Each folder icon in the left window represents a key. Just as there are subfolders under a folder, there are subkeys under the keys of the registry. In order to represent a subkey completely, it is customary to use the path representation of folders. When we select a key (or subkey) in the left window of the Registry Editor, what appears in the right window is the key value (Value) of the key, which can be divided into two parts: the key name (Name) and the data (Data). For each key, there is at least one default value (Default Value). For example, the "HKEY_CLASSES_ROOT\.bmp" subkey has a default value of "ACDC_BMP." In addition to the default key value, this subkey also contains the Name "Content Type" and Data "image/bmp".

VB. NET registry functions provided by itself

Now that you understand the organization of the registry, let's discuss how to access it. Just as we must specify the folder (directory) in which the file is located when accessing the file, we must specify the key when accessing the registry. key What you see in Registry Editor is a long string of characters, such as

"HKEY_LOCAL_MACHINE\SOFTWARE\ Microsoft\Windows \CurrentVersion"。

Within Visual Basic 6.0, a standard registry location has been provided to store program information for applications created in VB: HKEY_CURRENT_USER\Software\VB and VBA Program settings\(for simplicity of description, this location will be referred to below as the "standard location"). VB provides two statements and two functions to handle program settings stored in the application registry:

GetSetting(appname, section, key[, default]): Retrieves registry settings.

Statement SaveSetting appname, section, key, value: Save or create registry settings.

GetAllSettings(appname, section): Returns an array of registry settings.

DeleteSetting appname, section[, key]: Delete a registry setting.

Description of parameters used above:

[ ]: Indicates optional.

appname: String expression containing the name of the application or project, a subkey below the standard position.

section: String expression containing the name of the region, a subkey under appname.

key: string expression, standard position\appname\

The key name of the section subkey (Value Name).

value: string expression, standard position\appname\

The section subkey corresponds to the Value of the key name.

default: Expression that returns the default value if there is no set value in the registry key settings. If omitted, default is a zero-length string ("").

GetAllSettings returns Variant, a two-dimensional array of strings containing all registry key settings and their corresponding values in a specified region.

About "VB. NET registry organizational structure of the sample analysis" This article is shared here, I hope the above content can be of some help to everyone, so that you can learn more knowledge, if you think the article is good, please share it to let more people see.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Development

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report