asp.net C# ·¢ËÍ Óʼþ ºÍ ¸½¼þ ´úÂë
˵µ½·¢ËÍÓʼþ·¢ËÍ£¬ÏÈÌáÒ»ÏÂSMTP(ºÇºÇ£¬¸ßÊÖ¾ÍÌø¹ýÕâÒ»¶Î°É£¡)¡£ SMTPµÄÈ«³ÆÊÇ“Simple Mail Transfer Protocol”£¬¼´¼òµ¥Óʼþ´«ÊäÐÒé¡£ËüÊÇÒ»×éÓÃÓÚ´ÓÔ´µØÖ·µ½Ä¿µÄµØÖ·´«ÊäÓʼþµÄ¹æ·¶£¬Í¨¹ýËüÀ´¿ØÖÆÓʼþµÄÖÐת·½Ê½¡£SMTP ÐÒéÊôÓÚ TCP/IP ÐÒé´Ø£¬Ëü°ïÖúÿ̨¼ÆËã»úÔÚ·¢ËÍ»òÖÐתÐżþʱÕÒµ½ÏÂÒ»¸öÄ¿µÄµØ¡£SMTP ·þÎñÆ÷¾ÍÊÇ×ñÑ SMTP ÐÒéµÄ·¢ËÍÓʼþ·þÎñÆ÷¡£
ÔÙ¼òµ¥½éÉÜÒ»ÏÂÃû³Æ¿Õ¼ä£¨NameSpace£©System.Web.MailÀà¿âÀïËùÌṩµÄÓʼþ·¢Ë͵ĶÔÏó¡¢ÊôÐԺͷ½·¨
(1)ËüÓÐÈý¸öÀࣺSmtpMail¡¢MailMessageºÍMailAttachment¡£ÕâÈý¸ö¶ÔÏó±¾ÎĵÄʾÀý³ÌÐò´úÂëÖж¼Ó¦Óõ½ÁË£¡
1. MailMessage ,ÌṩÊôÐԺͷ½·¨À´´´½¨Ò»¸öÓʼþÏûÏ¢¶ÔÏó¡£(Provides properties and methods for constructing an e-mail message.)
2. MailAttachments – ÌṩÊôÐԺͷ½·¨À´´´½¨Ò»¸öÓʼþ¸½¼þ¶ÔÏó¡£(Provides properties and methods for constructing an e-mail attachment.)
3. SmtpMail – ÌṩÊôÐԺͷ½·¨Í¨¹ýʹÓÃwindows 2000 CDOSYS µÄÏûÏ¢×é¼þµÄÁªºÏÊý¾Ý¶ÔÏóÀ´·¢ËÍÓʼþÏûÏ¢£©¡£(Provides properties and methods for sending messages using the Collaboration Data Objects for Windows 2000 (CDOSYS) message component)
(2)¸÷¸öÀàµÄÊôÐÔ¡£
1.Ïȼòµ¥½éÉÜSmtpMailµÄÊôÐÔ£º SmtpServer -- SMTPµÄµØÖ·¡£
2.Ö÷ÒªÀ´½éÉÜMailMessage¶ÔÏóµÄÊôÐÔ
from -- ·¢ËÍÓʼþµÄµØÖ·
To -- ½ÓÊÜÓʼþµÄµØÖ·
Subject -- ÓʼþµÄ±êÌâ
Priority -- ÓʼþµÄÓÅÏȼ¶£¨ÓÐЧֵΪHigh,Low,Normal£©
Attachments -- ·µ»ØÒ»¸ö¼¯ºÏ£¬´ú±í¸½¼þ
Bcc -- ÃÜË͵
Ïà¹ØÎĵµ£º
//private string datapatch = ConfigurationSettings.AppSettings["acessconn"];//Êý¾Ý¿âµØÖ·
private string datapatch = "db/global.asa";//Êý¾Ý¿âµØÖ·
///
/// È¡µÃdataset
//
/// ²éѯÓï¾ä
///
public DataSet GetDataSet(string Commandtext)
{&nbs ......
Introduction
In this article, we will take a closer look at how ASP.NET pages post back to themselves, and how to customize this feature in our web applications.
function __doPostBack(eventTarget, eventArgument)
One of the most important features of the ASP.NET environment is the ability to decla ......
public class PageBase:System.Web.UI.Page
{
public PageBase()
{
//
// TODO: Add constructor logic here
//
}
protected override void InitializeCulture()
{
// ......
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)
² ......