Web event log
Web Event Logs to write event logs for web programs is a daily very needed feature. Here, you will pay attention to: First, you must handle Global.asax / ErrorGlobal.asaxprotaced Void Application_ERROR (Object Sender, Eventargs E) {string err = "SchoolWeb Application error / n / n "; Err =" Request: " Request.url.toString () " / n / n "; Err =" strack trace: / n " server.getlasterror (). Tostring ); Systemframeworks.error.log (ERR);} Second to pay attention to IIS privilege: // To assign write access to IIS in the registry system log to IIS, 2003 To change the registration table: hkey_local_machine / system / currentControlSet / Services / EVENTLOGHKEY_LOCAL_MACHINE / SYSTEM / CURRENTCONTROLSET / SERVICES / EVENTLOG On this button - "Permission Point" Add "then" Advanced "-" "Find Now" There is "IIS_WPG" user, add, then this permission is not good Use Machine.config to change username = "machine" password = "autogenerate" to username = "system" password = "autogenerate" finally writing a class to uniform processing: / using system; use system.diagnostics; namespace Winxiyu . DataAccess {////