Using Log4net-1.2.0-beta8
Set in the project's AssemblyInfo.cs file
[Assembly:log4net. Config.domconfiguratorattribute (Watch=true)]
Add and edit the project configuration file (default is app.config), which reads as follows:
The following statement is used in the program code
...
Using Log4net;
Using Log4net.
Http://www.cnblogs.com/qingyi/archive/2010/01/14/1647915.htmlAlways forget something with some things, remember it here first.I. Configuration1. Associate profiles are configured in AssemblyInfo.csAdd [Assembly:log4net. Config.domconfigurator (configfile= "Log4net.config", configfileextension= "ext", Watch=true/false)]Descriptionconfigfile-== refers to the path of the log4net configuration file, relative to
Log4net. dll
1. Configuration
% M (message): Log message
% N (new line): line feed
% D (datetime): Current Time
% R (run time): time consumed in milliseconds
% T (thread id): ID of the thread
% P (priority): priority
% C (class): class Object Name
% L: the row number of the output statement
% F: File Name of the output statement
%-Number: indicates the minimum length of the item. If not, fill it with spac
App. ConfigThe application configuration file is a standard XML file, and the XML tag and attribute are case sensitive. It can be changed as needed. developers can use the configuration file to change the settings without re-compiling the application.The root node of the configuration file is
When developing a web project, a configuration file web. config is used to store global variables, such as strings used to connect to the database. Correspondingly, when developing the winform program, there is also a configuration file, which is the app. config, the role of
= configurationmanager.appsettings["Demokey"];Write a statement:Configuration CFA = configurationmanager.openexeconfiguration (Configurationuserlevel.none);CfA. appsettings.settings["Demokey"]. Value = "Demovalue";CfA. Save ();Configuration file Content format: (app. config)several key sections marked with red pens are requiredsystem.configuration.configurations
The application configuration file is a standard XML file, and XML tags and attributes are case-sensitive. It can be changed as needed, and developers can use the configuration file to change the settings without having to recompile the application.The root node of the profile is the configuration file. We often visit appsettings, which is made up of. NET pre-def
During Winform development, some configuration information is inevitably written to the APP. in the CONFIG file, after the program is generated, the APP. CONFIG is changed to A file with the program name + CONFIG. For example, if
When developing a Web project, a configuration file, Web. config, is used to hold global variables, such as strings used to connect to the database. Accordingly, in the development of the WinForm program, there is also a configuration file, which is the app. config, which fu
Recently, I am working on a winform project. Because I am using the client to directly connect to the database, I need to deploy the app on the client. config. Because Enterprise Library is used. the connectionstrings In the config file are encrypted and searched for msdn, and a ready-made tool is available.
ASP. net iis registration tool (aspnet_regiis.exe), but
app. ConfigRead the statement:String str = configurationmanager.appsettings["Demokey"];Write a statement:Configuration CFA = configurationmanager.openexeconfiguration (Configurationuserlevel.none);CfA. appsettings.settings["Demokey"]. Value = "Demovalue";CfA. Save ();Configuration file Content format: (app. config)sev
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 file/// /// /// Public static void setconfig (string key, string value){Configuration
programs
First, you must reference the system. configuration file in the project, and then reference it with using system. configuration. Otherwise, the configurationmanager class cannot be found.
Code of the program (demo_setup.exe) for configuring the Data Warehouse connection:
Configuration Config = configuration
To: http://hi.baidu.com/xbzhu/blog/item/855a2f126f034554f819b828.html
Encrypt the winform app. config file
Recently, I am working on a winform project. Because I am using the client to directly connect to the database, I need to deploy the app on the client. config. Because Enterprise Library is used. the conn
For the appsetting node of the App. Config profile in C/s mode , the support configuration information is now available and can be persisted .
First, learn how to obtain the contents of the configuration information "Get configuration information Recommended Use this"
About app. config
During winform development, some configuration information is inevitably written to the app. config file. After the program is generated, the app. config file will be
From: http://www.cnblogs.com/xiaof2000/archive/2009/12/16/1625198.html
When I first used. net 2008, I wanted to write a database setting job to set the database connection and read the setting information in another program. A simple result .......
Someone mentioned the. NET bug. Someone used the. NET 1.0 method ......
After finding a lot of information, we won't use settings. settings, but finally solved it simply.
The Code is as follows:
App.
Environment vs2010It's easy to read. Basically, all users use configurationmanager. receivettings [""]. tostring ()Writing config is not very common.CodeAs follows:
Copy code The Code is as follows: // /// Modify the value of an item in the configuration file
/// /// /// Public static void setconfig (string key, string value)
{
Configuration
A project typically has only one configuration file. Web projects are used with the website. config, but sometimes you need to configure a file separately in your project. For example: App. Config, is that okay?The answer is yes. can be specified in Web. config. For example,
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.