主要我在2003的office测试下是没问题,但是程序不知道会不会在2000,2007的excel不兼容,条件有限,没有办法一个一个去测试,大家帮我看看,程序有没有什么弊端protected void LinkButton1_Click(object sender, EventArgs e)
    {
        selectManage sm = new selectManage();
        DataSet ds = sm.searchByselect("*");
        DataTable DtOut = ds.Tables[0];
            Response.Clear(); 
            Response.ContentEncoding = Encoding.Default; 
            Response.AppendHeader("content-disposition", "attachment; filename=" + HttpUtility.UrlEncode("OpenDay"+System.DateTime.Now.ToString("MM.dd")+".xls")); 
            Response.ContentType = "application/octet-stream";             for (int i = 0; i < DtOut.Columns.Count; i++) 
            { 
                Response.Write(DtOut.Columns[i].ColumnName.ToString() + "\t"); 
            }             Response.Write(Environment.NewLine); 
            for (int i = 0; i < DtOut.Rows.Count; i++) 
            { 
                
                StringBuilder sb = new StringBuilder(); 
                for (int j = 0; j < DtOut.Columns.Count; j++) 
                { 
                    sb.Append(DtOut.Rows[i][j].ToString()); 
                    sb.Append("\t"); 
                } 
                Response.Write(sb.ToString()); 
                Response.Write(Environment.NewLine); 
            }                Response.End(); 
        
        
    }