You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
36 lines
939 B
C#
36 lines
939 B
C#
using System;
|
|
using System.Collections.Generic;
|
|
using System.Linq;
|
|
using System.Web;
|
|
using System.IO;
|
|
|
|
namespace TradeManageNew.GlobalAshx
|
|
{
|
|
/// <summary>
|
|
/// ExcelHtml 的摘要说明
|
|
/// </summary>
|
|
public class ExcelHtml : IHttpHandler
|
|
{
|
|
|
|
public void ProcessRequest(HttpContext context)
|
|
{
|
|
string chtml = context.Request["chtml"];
|
|
string FileName = Guid.NewGuid().ToString();
|
|
string path = AppDomain.CurrentDomain.BaseDirectory + "ServerCookies/" + FileName+".xls";
|
|
File.WriteAllText(path, chtml);
|
|
context.Response.ContentType = "application/vnd.ms-excel";
|
|
context.Response.Charset = "utf-8";
|
|
context.Response.Write(path);
|
|
context.Response.End();
|
|
|
|
}
|
|
|
|
public bool IsReusable
|
|
{
|
|
get
|
|
{
|
|
return false;
|
|
}
|
|
}
|
|
}
|
|
} |