The SystemFramework project The SystemFramework project is a project that can be directly ported to other programs, which can be used directly without modifying or having little modification code. The project is mainly 3 classes. 1.ApplicationConfiguration class This class is a configuration class for the application level, implements the iConfigurationSectionHandler interface. That is the same as the previous DUWAMISHCONFIGURATION class. The main method is CREATE (), ONApplicationStart (), ReadSetting (). If you want to use this class, to be called to Application_OnStart event in Global.asax ApplicationConfiguration.OnApplicationStart (Context); public static void OnApplicationStart (String myAppPath) {appRoot = myAppPath; System.Configuration.ConfigurationSettings.GetConfig ( "ApplicationConfiguration"); System .Configuration.ConfigurationSettings.GetConfig ( "DuwamishConfiguration"); System.Configuration.ConfigurationSettings.GetConfig ( "SourceViewer");} this method calls the generic ConfigurationSettingis.GetConfig () method in Web.Config
A corresponding parsing class is obtained, and the corresponding CREATE () method is called. This is the case if there is no corresponding configuration parsing class.
2.
Applicationassert class This class is primarily used to help developers for errors, logging, etc. There is mainly Check (), checkcondition (), generatestacktrace () three methods and LINENUMBER attributes.
[ConditionaAttribute ("debug")] is applied to check (), and generatestacktrace () methods, which can be called if the debug constant is defined.
3.
ApplicationLog class This class is primarily used for logging.
Definition Error (1), Warning (2), Info (3), Verbose (4) Four Tracelevel Level Record Log Debugging and Tracking Information. Setting to Web.Config
Definition in the configuration section. All methods in this class are static methods, which is the main STATIC VOID WRITELOG (Level, MessageText)
If the written TraceLevel is not more than the level defined in the configuration, the corresponding debug is written, and the tracking information is written to the Windows event log in the Windows event log in the Windows event log in the defined level.
The constructor of the ApplicationLog class declares that the Private Static is initialized from the configuration file in the configuration file when the ApplicationLog class is called.
doubt:
1. Use System.Threading.monitor in static applicationLog () to ensure the security of multi-threaded operations. Why is the control of ApplicationLog to lock?
2. Certain types of understandings in the System.Diagnostics namespace are not very clear. MSDN Help: 1.Monitor class MS-help: //ms.msdnqtr.2003feb.2052/cpref/html/frlrfsystemthreadingMonitorClasStopic.htm 2.system.diagnostics Namespace (provide specific classes, allow you to be able to work with system processes, event logs Interact with performance counters) MS-help: //ms.msdnqtr.2003feb.2052/cpref/html/frlrfsystemDiagnostics.htm