Web. config is a configuration file for web applications. In the web program you developed, you can create a web. config.App. config is the configuration file of the desktop application. When you create a desktop application project in vs.net and add an application configuration file, it is automatically named
Whether it is web. config or app.
Please indicate from "Yang Guo under the bodhi tree"-http://www.cnblogs.com/yjmyzz/archive/2008/08/22/1274395.html
I. Use code for encryption and decryption
Code highlighting produced by Actipro CodeHighlighter (freeware)http://www.CodeHighlighter.com/-->Using System. Web. Configuration;
// Encrypt the specified section in web. Config
Private void ProtectSection (string sectionName)
{
Configuration config
Set Machine. config to the computer-level default value of the server application. If you want to force specific configurations for all applications on the server, you can use allowOverride = "false" on the
For those settings that can be configured based on a single application, the application usually provides the Web. config file. Although multiple
The main problem to consider is what settings should be
For example:
App. config
Providername = "system. Data. sqlclient"/>
Web. config
Set compilation DEBUG = "true" to insert debugging symbolsCompiled pages. However, thisPerformance is affected, so this value is only available during development.Set to true.-->You can use the IdentifiesSecurity Authentication mode.-->If an unprocessed error occurs during request execution,You can configure the corresponding
Autofac injection works with web. config, and autofacweb. config
Public static void BuildMvcContainer () {var builder = new ContainerBuilder (); var assemblys = AppDomain. currentDomain. getAssemblies (). toList (); // register the DLL after splitting. The DLL Assembly to be injected [] asm = GetAllAssembly ("*. controllers. dll "). toArray (); builder. registerAssemblyTypes (asm); // read the web. the Valu
Based on webpack. config. js parameters, webpack. config. js
The webpack. config. js file is usually stored in the project's root directory. It is also a standard Commonjs specification module.
var webpack = require('webpack');module.exports = { entry: [ 'webpack/hot/only-dev-server', './js/app.js' ], output: { path: './build', filename: 'bundle.js' }, module
Encryption and decryption of database connection strings in ASP. NET web. config and web. config
Although not very fresh, I believe there are still many people who don't know, well, don't talk nonsense, just give the method: Start ---> Run, Enter cmd, and then enter the following content
Encryption:
C: \ WINDOWS \ Microsoft. NET \ Framework \ v2.0.50727 \ aspnet_regiis.exe-Arg "connectionStrings" "Your Web
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, resulting in the loss of all sessions currently.
6: ///
7: //
8: //
9: //
10: //
11: public static void ModifyAppSettings(string key, string strValue)
12:
When using mvc, using a strong view in the view does not work. Adding a namespace reference to the web. config file does not work. Solution: mvcweb. config
This is the model code in the view:
@ Model t_user_info
This is the only code for the web. config configuration file:
In this way, you do not need to add the following code to each view that uses the mod
Obtain the parameters set in Web. config in Asp. Net! (Front and back-end code example), asp. netweb. config
1. Set code in Web. config
2. Create sys. cs in App_Code
// Note: You need to add a reference namespace using.
Public class sys{Public static int deleted = int. Parse (ConfigurationManager. deleettings ["deleted"]);}
Iii. calls in cs files
If (aaa = syste
Add a setting in Web. config.
1. Construct a section between
You can also set a section group and the group can be nested.
2. Add the sections settings between
Or use the section group method.
3. Read Value
Dim config as namevaluecollection = configurationsettings. getconfig ("mysection ")OrDim config as namevaluecollection = configurationsettings. getconfig
Bitmap. Config and bitmap. configPreface
Android is a very memory-intensive system, so we need to be very cautious when using the memory during the process of program development, and Bitmap is the biggest object we come into contact, the following is based on Bitmap. the description of the Config value shows how Bitmap is stored in the memory. Select the appropriate configuration for storing Bitmap accordi
The configuration file is the basis and basis for the program itself. It is essentially an xml file. The operations on the configuration file are as follows. NET 2.0 is very convenient, and provides the System [. web]. to use the NameSpace of the Configuration management function, you need to add. configuration. dll reference.
For the WINFORM program, use System. Configuration. ConfigurationManager;
For ASP. NET programs, use System. Web. Configuration. WebConfigurationManager;
Reading configura
Detailed description of ASP. NET web. config configuration nodes, asp. netweb. config
Search rules for the web. config file:
(1) If the web. config file exists in the directory where the current page is located, check whether the node name to be searched exists. If yes, return the result and stop searching.(2) If the d
Data compression SecuritymaxAllowedContentLength set the maximum value of the uploaded file, allowdoubleescaping whether to check the URL contains the + number case MailsettingsMainly beneficial to SmtpClient, if the configuration is written in the appsetting need to manually fill the parameters, if the use of mailsettings, the situation becomes very simpleSMTP = new SmtpClient (); SMTP. Send (msg); Password= "Onr4qv2s" /> HttpprotocolSeemingly remove server does not work System.Webm
For configuration file trade-offs,. config VS. xml,. config. xml
As we all know, some of the flexibility of the program is "configuration.
Of course, the config file has never been easy for. NET users. At least, I think it is very troublesome.
1. config
. NET configuration file is convenient, in fact, the most conveni
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.