excel表格数据转Json数据
我用的是 OleDbConnection Newtonsoft.Json
废话不多说,开撸!
public class ExcelToJson : IHttpHandler {
public void ProcessRequest (HttpContext context) {
string rootPath = "e:\\epfile\\";
//接收文件
HttpFileCollection files = context.Request.Files;
HttpPostedFile file = files[0];
if (file.ContentLength > 1024 * 1024 * 10)
{
//异域访问的声明
context.Response.Headers.Add("Access-Control-Allow-Origin", "*");
context.Response.ContentType = "text/plain";
context.Response.Write(BaseResponse("1", "文件大小不能超过10M"));
return;
}