This project used to read the custom config file, so I wrote this example as my technical accumulation.
I created a URL. config file under the root directory of the website.
The content is as follows:
XML version = "1.0" encoding = "UTF-
Fault logging:1, Environment: ESXi 5.1, VCenter 5.1;2, fault Description:A. When you open the VM console in Vcenter, the following error message is displayed:"Unable to connect to the Mks:virtual machine config file does not exist."650) this.width=65
Develop your own blog. NET version step by step (11. Read and modify the Web. config file),. netweb. configRead Web. config
The reading of Web. config is very special. Usually, we usually use the configuration under the deleteworker node. For
In ASP. in net2.0, the web. you can use rsaprotectedconfigurationprovider and dpapiprotectedconfigurationprovider to encrypt some data in config. This document describes how to use rsaprotectedconfigurationprovidert and a computer-level key
Because the IP address of our system may change when it is released in the LAN, I plan to add a function to modify the IP address in the program, find a port that is a little unpopular, but the IP address can be modified. I checked the information
The default location of the machine config file is % WinDir % \ Microsoft. NET \ framework \ framework_version \ config.
If you open the. NET 3.5 folder, you will find that there is no machine. config file.
Why?
. Net 3.5 is only the layer
The following is the definition of app.config or web.config, which defines a parameter, the key is Isinit, and the value is False
The following is the method definition for the read and write config file:
Write:
Copy Code code as follows:
xml| Program
In the decision distribution is based. NET Framework, you decide how to manage the settings for your public programs. To improve code reuse and application interoperability, all application –web, Windows, WEB services, and Windows
The error is as follows:Org.hibernate.hql.ast.QuerySyntaxException:Content is not mapped [select New Content (T.id,t.name,t.values, T.systemtype,t.type,t.sortnumber) from Content t where 1=1 and T.type =? and T.systemtype =? ORDER BY T.sortnumber
Config file detailed
The above is the config file detailed content, more relevant content please pay attention to topic.alibabacloud.com (www.php.cn)!
If we write the database connection information, that is, the database connection string, in web. config, it not only enhances program security, but also greatly facilitates program modification.
In the web. the keyword key is added to the config
Execonfigurationfilemap This class provides the ability to modify and obtain the specified config;Create a new instance of Execonfigurationfilemap ECF;and set the Execonfigfilename property to the config file path to operate;Using the
1: ///
2: // modify the value Attribute in Add in the appSettings configuration section of the web. config or app. config file.
3: ///
4: ///
5: // Note: after calling this function, the entire Web Application will be restarted,
Spring Read configuration file:1. Spring load config file: 2. configuration file Contents: ytz_special_user_phone=13912622596,18721293900,18656253360ytz_special_user_phone2= 13912622596,18721293900,186562533603. Inject the attribute value through
PHP is loaded into Apache as a module, and the PHP config file directory is c:windows. This is unreasonable, should choose the PHP itself directory configuration file load, can be set in Apache httpd.conf configuration file Phpinidir "here to fill
The application configuration file for ASP. NET is Web. config for the WinForm program is app. config (ExeName.exe.config).Configuration file, for the program itself, is the basis and basis, its essence is an XML file, for the operation of the
Environment vs2010
It's easy to read. Basically, all users use configurationmanager. receivettings [""]. tostring ()
Writing config is not very common.CodeAs follows:
/// /// Modify the value of an item in the configuration
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.