asp.net´íÎó´¦Àí
³öÏÖ´íÎó·¢ËÍEmail
¿ÉÒÔÔÚGlobal.asaxµÄvoid Application_Error(Object sender,EventArgs e)
{
//Óõ½ÁËSsytem.Net.Mail
MailMessage mail=new MailMessage();
mail.from=new MailAddress("automated@contoso.com");
mail.Subject="SIte Error at" +DateTime.Now;
mail.Body="Error Decription"+ ex.Message;
SmtpClient server=new SmtpClient();
server.Host=outgoingMailServerHost;
server.Send(mail);
}
///½¨×³µÄ´íÎó´¦Àí
1¡£Ô¤²âÎÊÌ⣬¾ßÌå×ö·¹ÊÇ°ÑËùÓпÉÄÜ·¢Éú¹ÊÕÏ´úÂë·â×°ÔÚtry/catch/finnally¿éÖУ¬µ¥Æ¾ÕâÒ»µã²¢²»Äܱ£Ö¤²»»á³öÏÖÒì³££¬ÖÁÉÙ»¹ÒªÕýÈ·µÄ´¦Àí³£¼ûµÄÒì³£
2¡£²»ÒªÁôÏÂÈκÎδ´¦ÀíµÄÒì³££¬Ö»Òª×ñÑÕâ¸öÖ¸µ¼ÔÔò£¬¼´Ê¹Î´ÄÜÔ¤²âµ½Ä³ÖÖÎÊÌ⣬ҲÖÁÉÙ²»»áÈÃÓû§¿´µ½Òì³£Ò³Ã棬ÎÒÃÇ¿ÉÒÔÔÚÒ³Ã漶ºÍÓ¦ÓóÌÐò¼¶ÊµÊ©ÕâÒ»Ö¸µ¼ÔÔò£¬²»ÓÃ˵£¬Ó¦ÓóÌÐò¼¶±ð´íÎó´¦Àí³ÌÐòÓÅÏÈÓÚÒ³Ã漶´¦Àí³ÌÐò
3¡£È·±£´íÎóÒ³Ãæ²»»áй©ÈκÎÃô¸Ð×ÊÁÏ£¬ÈçÓбØÒª£¬Çø·Ö±¾µØÓû§ºÍÔ¶³ÌÓû§£¬²¢Ö»¶Ô±¾µØÓû§ÏÔʾÏûÏ¢£¬±¾µØÓû§±»¶¨Òåδ´ÓWeb·þÎñÆ÷»úÆ÷·ÃÎÊÓ¦ÓóÌÐòµÄÓû§
web.config ÖеÄ<customErrors>½Ú
<customErrors mode="RemoteOnly"> mode Off/RemoteOnly/On
¸üרҵµãµÄ Ò»°ãÓÃmode£½"RemoteOnly"Ïò±¾µØÓû§ÏÔʾÏêϸ´íÎó£¬ÏòÔ¶³ÌÓû§ÏÔʾ´íÎóÒ³Ãæ
<customErrors mode="On" defaultRedirect="/Error.aspx">
<error statusCode="404" redirect="Errro404.aspx"/>
</customErrors>
Ïà¹ØÎĵµ£º
ÔÚWeb±à³Ì¹ý³ÌÖУ¬´æÔÚןܶలȫÒþ»¼¡£±ÈÈçÔÚÒÔÇ°µÄASP°æ±¾ÖУ¬CookieΪ·ÃÎÊÕߺͱà³ÌÕ߶¼ÌṩÁË·½±ã£¬²¢Ã»ÓÐÌṩ¼ÓÃܵŦÄÜ¡£´ò¿ªIEä¯ÀÀÆ÷£¬Ñ¡Ôñ“¹¤¾ß”²Ëµ¥ÀïµÄ“InternetÑ¡Ï¬È»ºóÔÚµ¯³öµÄ¶Ô»°¿òÀïµ¥»÷“ÉèÖÔ°´Å¥£¬Ñ¡Ôñ“²é¿´Îļþ”°´Å¥£¬ÔÚµ¯³öµÄ´°¿ÚÖУ¬¾Í»áÏÔʾӲÅÌÀï ......
дͼƬc:\1.jpgµ½±ícinfoÖÐ
private static void AddCinfo()
{
string strSql = "insert into cinfo (srvtitle,csttitle,introduction,logo) values
(@srvtitle,@csttitle,@introduction,@logo)";
S ......
asp.net ѧϰ×ÊÔ´
¹ØÓÚ´ËÖ÷Ìâ½öÓÐ 1 ¸öÌû×Ó - Ê÷ʽä¯ÀÀ
astin...@gmail.com
9ÔÂ26ÈÕ ÉÏÎç12ʱ41·Ö ÏÔʾѡÏî
·¢¼þÈË£º astin...@gmail.com - ²éÕÒ´Ë×÷ÕßµÄÌû×Ó
ÈÕÆÚ£ºSun, 25 Sep 2005 09:41:54 -0700
µ±µØʱ¼ä£º2005Äê9ÔÂ26ÈÕ(ÐÇÆÚÒ») ÉÏÎç12ʱ41·Ö
Ö÷Ì⣺asp.net ѧϰ×ÊÔ´
´ð¸´×÷Õ ......
ASP.NetÉú³É¾²Ì¬HTMLÒ³!
»·¾³:Microsoft .NET Framework SDK v1.1
OS:Windows Server 2003 ÖÐÎÄ°æ
ASP.NetÉú³É¾²Ì¬HTMLÒ³
ÔÚAspÖÐʵÏÖµÄÉú³É¾²Ì¬Ò³Óõ½µÄFileSystemObject¶ÔÏó!
ÔÚ.NetÖÐÉæ¼°´ËÀà²Ù×÷µÄÊÇSystem.IO
ÒÔÏÂÊdzÌÐò´úÂë ×¢:´Ë´úÂë·ÇÔ´´!²Î¿¼±ðÈË´úÂë
//Éú³ÉHTMLÒ³
public static bool W ......