在web中js实现类似excel的表格控件(2)

public class CSEngine : IHttpHandler { private static int count = 0; public void ProcessRequest (HttpContext context) { context.Response.ContentType = "text/plain"; try { count++; string ret = ""; string code = context.Request["code"].ToString(); if (string.IsNullOrEmpty(code)) { ret = "参数错误"; } else { ScriptOptions options = ScriptOptions.Default .AddReferences( Assembly.GetAssembly(typeof(DBServices.DataAccess)) ) //.AddImports("System.Data") //.AddImports("System.Data.SqlClient") .AddImports("DBServices"); var state = CSharpScript.RunAsync(code, options).Result.ReturnValue; ret = state.ToString(); state = null; options = null; } Console.WriteLine(count); context.Response.Write(ret); } catch(Exception ex) { //error Console.WriteLine(count); } } public bool IsReusable { get { return false; } } }

运行代码,如下:

在web中js实现类似excel的表格控件

内容版权声明:除非注明,否则皆为本站原创文章。

转载注明出处:https://www.heiqu.com/wzfgsx.html