using System; using System.Collections.Generic; using System.Linq; using System.Web; using System.Web.UI; using System.Web.UI.WebControls; namespace Web.Test._Excel { using Web.Utils; using System.Data; using System.Data.SqlClient; using System.Drawing; public partial class Default : System.Web.UI.Page { DataSet ds; DataTable dt; protected void Page_Load(object sender, EventArgs e) { string sql = "select top 30 o.* from T_WordInfo o"; ds = HelperDb.ExecuteAll(HelperDb.connStr, CommandType.Text, sql, HelperKeys.DataSet) as DataSet; if (HelperValidate.CheckedDataSet(ds)) { dt = ds.Tables[0]; this.gv01.DataSource = dt = ds.Tables[0]; this.gv01.DataBind(); } } protected void Button1_Click(object sender, EventArgs e) { // ExcelHelper e = new ExcelHelper(); //ExcelHelper.OutputToExcel(dt,"C:\\1.xls"); //MailAttachments ma = new MailAttachments(); //ma.Add(@"C:\1.xls"); //MailMessage mail = new MailMessage(); //mail.Attachments = ma; //mail.Body = "你好"; //mail.AddRecipients("[email protected]"); //mail.From = "[email protected]"; //mail.FromName = "zkp"; //mail.Subject = "hello ni"; //SmtpClient sp = new SmtpClient(); //sp.SmtpServer = "smtp.qq.com"; //sp.Send(mail, "[email protected]", "aaa"); YZMHelper y = new YZMHelper(); y.CreateImage(); Bitmap b = y.Image; //Panel1.BackImageUrl = b; //ImageMap1. //Response.Write(b); } } }
时间: 2024-11-10 23:34:37