In Asp.net, when you need to read the configuration file, it is generally used to read the database connection string. This is simple and practical configurationmanager. connectionstrings ["ompdbconn"]. connectionstring is enough, but reading a node like authentication is a little troublesome.
When using the SDK to introduce web configuration files Note that when calling this openmachineconfiguration () function, you must note that if you enter a string. empty: reads the default configuration file of Asp.net, which is displayed on my machine: C: \ WINDOWS \ Microsoft. net \ framework \ v2.0.50727 \ config \ Web. config; if "/" is entered, the configuration file of the wwwroot root directory is read, which is generally: C: \ Inetpub \ wwwroot \ Web. config. that is to say, if you want to read a non-followed directory Program, You need to pay special attention to the path filled in. Read this web application to use "~ ", Add the corresponding folder name suffix when reading the configuration file of the corresponding child node.