ÓÃasp.net·¢ËÍÓʼþ£¬²âÊԳɹ¦
//Ò»£ºÓÃ×Ô¼ºµÄ·þÎñÆ÷×÷ΪÓʼþ·þÎñÆ÷ʱ£º
//Èç³öÏÖ£ºÓÊÏä²»¿ÉÓᣠ·þÎñÆ÷ÏìӦΪ: 5.7.1 Unable to relay for ***@gmail.com
//½â¾ö°ì·¨ÈçÏ£ºÔÚIISÖУ¬ÓÒ»÷“ĬÈÏSMTPÐéÄâ·þÎñÆ÷”£¬Ñ¡Ôñ“ÊôÐÔ”£¬Çл»µ½“·ÃÎʔҳ£¬µã»÷“Öм̔°´Å¥£¬ÔÚµ¯³ö¿òÖÐÑ¡Ôñ“½öÒÔÏÂÁбí³ýÍ┣¬È·¶¨¡£
//¶þ£ºÓÃÆäËüµÄÓʼþ·þÎñÆ÷·¢ËÍ£¬¾²âÊÔ´ó¶àÊýÃâ·ÑÓÊÏ䶼²»ÌṩSMTP·þÎñ£¬ÓÃqqÓÊÏäµÄ¾Í¿ÉÒÔ£¬·½·¨£º½øÈëqqÓÊÏ䣣£¾ÉèÖ㣣¾ÕÊ»§£££¾¿ªÍ¨POP3/IMAP/SMTP·þÎñ£¬¼´¿ÉÓÃsmtp.qq.com×÷ΪÓʼþ·þÎñÆ÷ÁË£¬¿ÉÓÃËüÀ´·¢ËÍÓʼþ
using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using System.Net.Mail;
public partial class _Default : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
}
public void SendSMTPEMail(string strSmtpServer, string strfrom, string strfromPass, string strto, string strSubject, string strBody)
{
System.Net.Mail.SmtpClient client = new SmtpClient(strSmtpServer);
client.UseDefaultCredentials = false;
client.Credentials = new System.Net.NetworkCredential(strfrom, strfromPass);
client.DeliveryMethod = SmtpDeliveryMethod.Network;
System.Net.Mail.MailMessage message = new MailMessage(strfrom, strto, strSubject, strBody);
message.BodyEncoding = System.Text.Encoding.UTF8;
message.IsBodyHtml = true;
client.Send(message);
}
//µÚÒ»¸ö²ÎÊýÊÇÓÊÏä·þÎ
Ïà¹ØÎĵµ£º
asp.net´íÎó´¦Àí·½·¨ ´ó²¿·Ö¶¼Óà try catch
ÎÒÃÇÒ²¿ÉÒÔÔÚÒ³Ã涨Òå protected void Page_Error(object sender, EventArgs e)·½·¨´¦Àí´íÎóÐÅÏ¢
{
//ÏÈ»ñÈ¡µ±Ç°·¢ÉúÒì³£
Exception ex = Server.GetLastError().GetBaseException();
if (ex is ArgumentOu ......
¼¯ºÏÊôÐÔÏàÐÅ´ó¼Ò¶¼ºÜÊìϤҲºÜ³£ÓÃ,ÈçDropDownList,ListBoxµÈ¿Ø¼þ
﹤asp:DropDownList ID="DropDownList1" runat="server"﹥ ﹤asp:ListItem﹥²âÊÔ1﹤/asp:ListItem﹥ & ......
ÏÈÉý¼¶ieµ½5.5°æÒÔÉÏ
1 ÏÂÔØÖÐÎÄ°æIE6:http://download.microsoft.com/download/ie6sp1/finrel/6_sp1/W98NT42KMeXP/CN/ie6setup.exe
2 ÏÂÔØmdac°²×° Ö±½ÓÏÂÔØ2.8ÖÐÎÄ°æ:http://download.microsoft.com/download/8/b/6/8b6198c0-fe96-4811-9d81-d5c76dd5fea8/MDAC_TYP.EXE
3 È»ºóÏÂÔØ.NET Framework 1.1°æ¿ÉÔÙ· ......
public DataSet ExcelToDS(string Path)
{
string strConn = "Provider=Microsoft.Jet.OLEDB.4.0;" + "Data Source=" + Path + ";" + "Extended Properties=Excel 8.0;";
OleDbConnection conn = new OleDbConnection(strConn);
conn.Open();
string strExcel = "";
Ole ......
ΪÁËÍü¼Ç:
1,System.Web.Hosting.ISAPIRuntime.ProcessRequest(IntPtr, Int32);:void
//´ÓIISÀ´µÄÇëÇó
2,System.Web.HttpRuntime.ProcessRequestInternal(HttpWorkerRequest) : Void
//ÔÚÕâÒ»²½´´½¨Ò»¸öHttpContext¶ÔÏó
3, System.Web.HttpApplicationFactory.GetApplicationInstance(HttpContext) : IHttpHandler
// ......