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 ......
ÏÂÃæÒª½â¾öµÄÎÊÌâÈçÏ£º
1.ÈçºÎÔÚJavaScript·ÃÎÊC#º¯Êý?
¡¡¡¡2.ÈçºÎÔÚJavaScript·ÃÎÊC#±äÁ¿?
¡¡¡¡3.ÈçºÎÔÚC#ÖзÃÎÊJavaScriptµÄÒÑÓбäÁ¿?
¡¡¡¡4.ÈçºÎÔÚC#ÖзÃÎÊJavaScriptº¯Êý?
¡¡¡¡ÎÊÌâ1´ð°¸ÈçÏ£º
¡¡¡¡javaScriptº¯ÊýÖÐÖ´ÐÐC#´úÂëÖеĺ¯Êý£º
¡¡¡¡·½·¨Ò»£º
&nbs ......
http://www.chinaz.com/Program/.NET/101U1142006.html
¡¡¡¡1. ´ò¿ªÐµĴ°¿Ú²¢´«ËͲÎÊý£º
´«ËͲÎÊý£º
response.write("<script>window.open('*.aspx?id="+this.DropDownList1.SelectIndex+"&id1="+...+"')</script>")
½ÓÊÕ²ÎÊý£º
string a = Request.QueryString("id");
string b = Request.QuerySt ......
substring
public String substring(int beginIndex)·µ»ØÒ»¸öеÄ×Ö·û´®£¬ËüÊÇ´Ë×Ö·û´®µÄÒ»¸ö×Ó×Ö·û´®¡£¸Ã×Ó×Ö·û´®Ê¼ÓÚÖ¸¶¨Ë÷Òý´¦µÄ×Ö·û£¬Ò»Ö±µ½´Ë×Ö·û´®Ä©Î²¡£
ÀýÈ磺
"unhappy".substring(2) returns "happy"
"Harbison".substring(3) returns "bison"
"emptiness".substring(9) returns "" (an empty string)
² ......
The Model-View-Controller (MVC) architectural pattern separates an application into three main components: the model, the view, and the controller. The ASP.NET MVC framework provides an alternative to the ASP.NET Web Forms pattern for creating MVC-based Web applications. The ASP.NET MVC framework is ......