ASP.NET 2.0·¢Ë͵ç×ÓÓʼþÖдæÔÚµÄÎÊÌâ
³ö´¦£º Ì켫yesky ×÷ÕߣºÖìÏÈÖÒ±àÒë ʱ¼ä£º2006-11-15 11:26:00
ÔÚз¢ÐеÄASP.NET 2.0°æ±¾ÖУ¬Î¢Èí²»ÔÙ½¨ÒéʹÓÃSystem.Web.MailÃüÃû¿Õ¼ä¶ø´úÖ®ÒÔеÄSystem.Net.MailÃüÃû¿Õ¼ä¡£ÔÚÕâ¸öпâÖÐÒýÈëÁËÐí¶àÐÂÌØÕ÷£¬µ«ÊÇÔÚ·¢ËÍÓʼþµÄ·½Ê½·½ÃæÒ²ÏàÓ¦µØ´øÈëÁËһЩС´íÎó¡£
Ò»¡¢ ·¢ËÍÓʼþ
ÔÚÏêϸÌÖÂÛÕâЩС´íÎó֮ǰ£¬ÈÃÎÒÃÇÏÈ¿´Ò»¶ÎʾÀý´úÂë(ÎÒÃǼٶ¨ÄãÒѾÔÚÎļþ¿ªÊ¼Ìí¼ÓÁË"using System.Net.Mail")£º MailMessage msg = new MailMessage();
msg.from = new MailAddress("address@domain.com"£¬ "Person's Name");
msg.To.Add(new MailAddress("destination@domain.com"£¬ "Addressee's Name");
msg.To.Add(new MailAddress("destination2@domain.com"£¬ "Addressee 2's Name");
msg.Subject = "Message Subject";
msg.Body = "Mail body content";
msg.IsBodyHtml = true;
msg.Priority = MailPriority.High;
SmtpClient c = new SmtpClient("mailserver.domain.com");
c.Send(msg); ÉÏÃæµÄ´úÂëÓëÒÔÇ°°æ±¾ÖеÄʵÏֲ̫¶à£¬½öÊÇÔÚÖ¸¶¨ÏûϢʱ×÷ÁËһЩСµÄ¸Ä¶¯¡£²»±Ø×Ô¼ºÀ´¹¹½¨Ò»¸öµØÖ·£¬ÄãÍêÈ«¿ÉÒÔÈÃϵͳΪÄã´úÀÍ¡£Èç¹ûÄãÖ¸¶¨Ò»¸öµç×ÓÓʼþµØÖ·ºÍÒ»¸öÃû×Ö£¬Ëü½«×Ô¶¯µØÔÚÏûÏ¢ÖÐÏÔʾÈçÏÂÄÚÈÝ£º "Person's Name" ÕâÕýÊÇÒ»¸öµç×ÓÓʼþµØÖ·µÄ"ÕýÈ·"¸ñʽ¡£µ±È»£¬Äã¿ÉÒÔ½øÒ»²½°Ñ¶à¸öµØÖ·Ìí¼Óµ½To£¬CCºÍBCC¼¯ºÏÖУ¬Æ䷽ʽÓëÉÏÃæÍêÈ«Ïàͬ¡£Í¨¹ýÕâÖÖ±à³Ì·½Ê½À´ÊµÏÖ·¢ËÍ´óÁ¿ÏûÏ¢Òª±È·Ö±ð·¢ËÍÿ¸öÏûÏ¢ÒªÈÝÒ׵öàÁË-Ö»ÐèÒª°Ñ¶à¸öµØÖ·Ìí¼Óµ½BCCÊôÐÔ¼´¿ÉʵÏÖÓʼþµÄȺ·¢¡£
¶þ¡¢ ´æÔÚµÄÎÊÌâ
ÏÖÔÚ£¬ÎÒÃÇÀ´·ÖÎöÒ»ÏÂÆäÖдæÔÚµÄС´íÎó¡£
ÈçÇ°ÃæËùÌá¼°£¬Õâ¸öеÄÃüÃû¿Õ¼äÖдøÓÐһЩС´íÎó¡£µÚÒ»¸öÊÇ£¬µ±Äã·¢ËÍÒ»·âµç×ÓÓʼþʱ£¬ÓʼþµÄÍ·²¿ÐÅϢȫ²¿ÊÇÒÔСд×ÖĸÐÎʽÌí¼ÓµÄ¡£È»¶ø£¬ÔÚÕë¶ÔSMTPÓʼþRFCµÄ¹æ·¶Öв¢Ã»ÓÐÖ¸¶¨ÓʼþÍ·²¿Ó¦¸ÃÔõÑù´óд£»µ«ÊÇ£¬Ðí¶àÀ¬»øÓʼþ¹ýÂ˳ÌÐòÈ´ÏÞÖÆÁËÍ·²¿Ã»ÓÐÕýÈ·´óдµÄµç×ÓÓʼþÏûÏ¢¡£
ÁíÒ»¸ö´íÎóÓëÓÅÏÈȨÉèÖÃÓйØϵ-ͨ¹ýÓÅÏÈȨÉèÖã¬Óû§¿ÉÒÔÖ¸¶¨Ò»¸öÏûÏ¢ÔÚÓʼþ¿Í»§¶ËµÄÖØÒª³Ì¶È¡£ÓÉÓÚÓʼþÍ·²¿µÄÕâÖÖ¸ñʽ»¯·½Ê½£¨È«²¿×ª»¯ÎªÐ¡Ð´£©£¬ËùÒÔ£¬ÎÒµÄÓʼþ³ÌÐò(Eudora)ÎÞ·¨Ê¶±ðÏàÓ¦µÄÓÅÏÈȨ±êÖ¾£¬Òò¶øÒ²¾Í²»»áרÃűê¼Ç³ö´ËÓʼþµÄÖØÒª³Ì¶È¡£¾¡¹ÜÕâ¿´ÉÏÈ¥ÓÐЩËöË飬µ«ÊÇת»»µ½Ð°汾µÄSystem.Web.MailÒÔºóÕâ¿´ÉÏÈ¥²¢Ã»ÓÐÃ÷ÏÔÀíÓÉ¡£
ËùÒÔ£¬ÎÒ»¹»á¼ÌÐ
Ïà¹ØÎĵµ£º
ÔÚWeb±à³Ì¹ý³ÌÖУ¬´æÔÚןܶలȫÒþ»¼¡£±ÈÈçÔÚÒÔÇ°µÄASP°æ±¾ÖУ¬CookieΪ·ÃÎÊÕߺͱà³ÌÕ߶¼ÌṩÁË·½±ã£¬²¢Ã»ÓÐÌṩ¼ÓÃܵŦÄÜ¡£´ò¿ªIEä¯ÀÀÆ÷£¬Ñ¡Ôñ“¹¤¾ß”²Ëµ¥ÀïµÄ“InternetÑ¡Ï¬È»ºóÔÚµ¯³öµÄ¶Ô»°¿òÀïµ¥»÷“ÉèÖÔ°´Å¥£¬Ñ¡Ôñ“²é¿´Îļþ”°´Å¥£¬ÔÚµ¯³öµÄ´°¿ÚÖУ¬¾Í»áÏÔʾӲÅÌÀï ......
Unicode ±àÂëÕýÖð½¥³ÉΪ¶àÓïÑÔÖ§³ÖµÄ×îͨÓýâ¾ö·½°¸¡£²ÉÓà Unicode ±àÂëµÄÖÐÎÄÍøÒ³ÄÜÔÚ¸÷ÖÖƽ̨¡¢¸÷ÖÖÀàµÄä¯ÀÀÆ÷É϶¼µÃµ½ºÜºÃµÄ¼æÈÝ¡£utf-8 ÊÇ Unicode µÄÒ»ÖÖ´æ´¢/½»»»ÊµÏÖ·½Ê½¡£¶ÔÓÚ²»Í¬ÊýÖµ·¶Î§µÄ Unicode Â룬Ëü²ÉÓñ䳤µÄ·½Ê½À´±àÂ룺ËùÓÐ ASCII ×Ö·ûÕ¼ÓÃ1¸ö×Ö½Ú£¬´óÓÚ 0x7f µÄÔòÕ¼ÓÃ2µ½4×Ö½Ú²»µÈ¡£¿ÉÒÔ¿´³ö£¬ËùÓÐ ASC ......
TreeView Web ·þÎñÆ÷¿Ø¼þÓÃÓÚÒÔÊ÷ÐνṹÏÔʾ·Ö²ãÊý¾Ý£¬ÈçĿ¼»òÎļþĿ¼¡£
Ò»¡¢TreeView ¿Ø¼þÖ§³ÖÏÂÃæµÄ¹¦ÄÜ£º
·×Ô¶¯Êý¾Ý°ó¶¨£¬¸Ã¹¦ÄÜÔÊÐí½«¿Ø¼þµÄ½Úµã°ó¶¨µ½·Ö²ãÊý¾Ý£¨Èç XML Îĵµ£©¡£
·Í¨¹ýÓë SiteMapDataSource ¿Ø¼þ¼¯³ÉÌṩ¶ÔÕ¾µãµ¼º½µÄÖ§³Ö¡£
·¿ÉÒ ......
1£®Ê÷ÐνṹµÄÉè¼Æ
ÔÚ¿ª·¢ASP.NETµÄÏîÄ¿ÖУ¬ÓÐÐí¶àÏîÄ¿Óõ½µÄÊ÷Ðνṹ£¬ÆäÖÐÓÐЩÊ÷ÐνṹÏà¶Ô¸´ÔÓ£¬Ò²Óмòµ¥µÄ£¬µ«ÎÞÂÛÊǼòµ¥µÄÊ÷Ðνṹ»¹ÊǸ´ÔÓµÄÊ÷Ðνṹ£¬ÓÐןõĽṹ¶ÔÓÚÐÔÄܺÍÎȶ¨ÐÔ¶¼ÓÐןܴóµÄ×÷ÓᣱÈÈçÄãµÄÊ÷½á¹¹µÄÊý¾ÝºÜ´ó£¬Èç¹ûÊDzÉÓñȽÏËÀµÄ·½Ê½Ò»´ÎÐÔ¼ÓÔؽøÀ´ÄÇôÄãÔÚ¼ÓÔØÕâ¿ÃÊ÷µÄʱºò¾ÍÊÇÏ൱µÄºÄ ......
protected void GridView1_RowDataBound(object sender, GridViewRowEventArgs e)
{
if (e.Row.RowType == DataControlRowType.DataRow)
{
  ......