日期:2011-07-14 浏览次数:20431 次
后台代码:
//-------------------------------------------------------------------------------------------------------
using System;
using System.Collections;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Web;
using System.Web.SessionState;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.HtmlControls;
using System.Web.Mail;
using System.IO;
namespace SendEmailModule
...{
/**//// <summary>
/// sendMailResume 的摘要说明。
/// </summary>
public class sendMailResume : System.Web.UI.Page
...{
protected System.Web.UI.WebControls.Panel panelMessage;
protected System.Web.UI.WebControls.Panel panelMain;
protected System.Web.UI.WebControls.RequiredFieldValidator rfvEmail;
protected System.Web.UI.WebControls.TextBox txtYourEmail;
protected System.Web.UI.WebControls.TextBox txtMessage;
protected System.Web.UI.WebControls.Button btnSubmit;
protected System.Web.UI.WebControls.RegularExpressionValidator RevEmail;
protected System.Web.UI.WebControls.Label lblAlert;
protected System.Web.UI.WebControls.Button btnUploadOk;
protected System.Web.UI.HtmlControls.HtmlInputFile fileUpload;
protected System.Web.UI.WebControls.Label lblUploadFileds;
protected System.Web.UI.WebControls.Panel PanelError;
private void Page_Load(object sender, System.EventArgs e)
...{
// First on Load
if(!this.IsPostBack)
...{
this.theArrayFile = new ArrayList();
}
}
private void btnUploadOk_Click(object sender, System.EventArgs e)
...{
string fullPath = this.fileUpload.PostedFile.FileName;
if(fullPath == "")
return;
string Filepostfix = fullPath.Substring(fullPath.LastIndexOf(".") + 1).ToLower();
if(Filepostfix == "doc" || Filepostfix == "pdf")
&