ASP.NET³ÌÐòÖг£ÓôúÂë»ã×Ü
ASP.NET³ÌÐòÖг£ÓôúÂë»ã×Ü
1.×Ô¶¨ÒåÒì³£´¦Àí
//×Ô¶¨ÒåÒì³£´¦ÀíÀà
using System;
using System.Diagnostics;
namespace MyAppException
{
¡¡/// £¼summary£¾
¡¡/// ´ÓϵͳÒì³£ÀàApplicationException¼Ì³ÐµÄÓ¦ÓóÌÐòÒì³£´¦ÀíÀà¡£
¡¡/// ×Ô¶¯½«Òì³£ÄÚÈݼǼµ½Windows NT/2000µÄÓ¦ÓóÌÐòÈÕÖ¾
¡¡/// £¼/summary£¾
¡¡public class AppException:System.ApplicationException
¡¡{
¡¡¡¡public AppException()
¡¡¡¡{
¡¡¡¡¡¡if (ApplicationConfiguration.EventLogEnabled)LogEvent("³öÏÖÒ»¸öδ֪´íÎó¡£");
¡¡¡¡}
¡¡public AppException(string message)
¡¡{
¡¡¡¡LogEvent(message);
¡¡}
¡¡public AppException(string message,Exception innerException)
¡¡{
¡¡¡¡LogEvent(message);
¡¡¡¡if (innerException != null)
¡¡¡¡{
¡¡¡¡¡¡LogEvent(innerException.Message);
¡¡¡¡}
¡¡}
¡¡//ÈÕÖ¾¼Ç¼Àà
¡¡using System;
¡¡using System.Configuration;
¡¡using System.Diagnostics;
¡¡using System.IO;
¡¡using System.Text;
¡¡using System.Threading;
¡¡namespace MyEventLog
¡¡{
¡¡¡¡/// £¼summary£¾
¡¡¡¡/// ʼþÈÕÖ¾¼Ç¼À࣬ÌṩʼþÈÕÖ¾¼Ç¼֧³Ö
¡¡¡¡/// £¼remarks£¾
¡¡¡¡/// ¶¨ÒåÁË4¸öÈÕÖ¾¼Ç¼·½·¨ (error, warning, info, trace)
¡¡¡¡/// £¼/remarks£¾
¡¡¡¡/// £¼/summary£¾
¡¡¡¡public class ApplicationLog
¡¡¡¡{
¡¡¡¡¡¡/// £¼summary£¾
¡¡¡¡¡¡/// ½«´íÎóÐÅÏ¢¼Ç¼µ½Win2000/NTʼþÈÕÖ¾ÖÐ
¡¡¡¡¡¡/// £¼param name="message"£¾ÐèÒª¼Ç¼µÄÎı¾ÐÅÏ¢£¼/param£¾
¡¡¡¡¡¡/// £¼/summary£¾
¡¡¡¡¡¡public static void WriteError(String message)
¡¡¡¡¡¡{
¡¡¡¡¡¡¡¡WriteLog(TraceLevel.Error, message);
¡¡¡¡¡¡}
¡¡¡¡¡¡/// £¼summary£¾
¡¡¡¡¡¡/// ½«¾¯¸æÐÅÏ¢¼Ç¼µ½Win2000/NTʼþÈÕÖ¾ÖÐ
¡¡¡¡¡¡/// £¼param name="message"£¾ÐèÒª¼Ç¼µÄÎı¾ÐÅÏ¢£¼/param£¾
¡¡¡¡¡¡/// £¼/summary£¾
¡¡¡¡¡¡public static void WriteWarning(String message)
¡¡¡¡¡¡{
¡¡¡¡¡¡¡¡WriteLog(TraceLevel.Warning, message);¡¡¡¡
¡¡¡¡¡¡}
¡¡¡¡¡¡/// £¼summary£¾
¡¡¡¡¡¡/// ½«ÌáʾÐÅÏ¢¼Ç¼µ½Win2000/NTʼþÈÕÖ¾ÖÐ
¡¡¡¡¡¡/// £¼param name="message"£¾ÐèÒª¼Ç¼µÄÎı¾ÐÅÏ¢£¼/param£¾
¡¡¡¡¡¡/// £¼/summary£¾
¡¡¡¡¡¡public static void WriteInfo(String message)
¡¡¡¡¡¡{
¡¡¡¡¡¡¡¡WriteLog(TraceLevel.Info, message);
¡¡
Ïà¹ØÎĵµ£º
/// <summary>
/// µÃµ½Õ¾µãÓû§IP
/// </summary>
/// <returns></returns>
public
static
string
getUserIP()
{
retu ......
ÔÚASP.NETÍøÕ¾¿ª·¢ÖпÉÄÜ»áÓöµ½Òª¸ü»»Êý¾Ý¿â£¬È罫Aceess»»ÎªSQL Server £¬ÓÉÓÚAceessÒýÓÃSystem.Data.OleDbÃüÃû¿Õ¼ä£¬SQL ServerÒýÓÃSystem.Data.SqlClientÃüÃû¿Õ¼ä¡£ÔÚÒ»°ã³ÌÐò´úÂëÖÐÎÒÃÇÐèÒª¸ü¸ÄÁ¬½Ó×Ö·û´®£¬ADO.NETÊý¾Ý·ÃÎÊÃüÁî¶ÔÏó£¬×îÂé·³µÄÊDz»Í¬Êý¾Ý¿âÓи÷×Ô²»Í¬SqlÃüÁî¡£ÎÒÃÇ¿ÉÒÔʹÓóéÏ󹤳§Ä£Ê½ÊµÏÖASP.NET·ÃÎʲ ......
ʾÀýÒ»
ÔÚGlobal.asax.csÎļþÖУº
protected void Application_Start(Object sender, EventArgs e)
{
System.Timers.Timer timer1 = new System.Timers.Timer();
&nbs ......
1. ´ò¿ªÐµĴ°¿Ú²¢´«ËͲÎÊý£º
´«ËͲÎÊý£º
response.write("£¼script£¾window.open('*.aspx?id="+this.DropDownList1.SelectIndex+"&id1="+...+"')£¼/script£¾")
½ÓÊÕ²ÎÊý£º
string a = Request.QueryString("id");
string b = Request.QueryString("id1");
2.Ϊ°´Å¥Ìí¼Ó¶Ô»°¿ò
Button1.Attribute ......