public tycxController(IHostingEnvironment _he, IHttpContextAccessor _hca, YsbqcSetting _set, Service _ser) { he = _he; hca = _hca; set = _set; service = _ser; }
// 摘要: // 由自定义 HTTP Web 请求的允许处理 HttpHandler 实现 System.Web.IHttpHandler 接口。 // // 参数: // context: // System.Web.HttpContext 提供对内部服务器对象的引用的对象 (例如, Request, ,Response, ,Session, // ,和 Server) 用于处理 HTTP 请求。 public void ProcessRequest(HttpContext context) { HttpRequest Request = context.Request; string questionId = Request.QueryString["questionId"]; string userquestionId = Request.QueryString["userquestionId"]; string companyId = Request.QueryString["companyId"]; string classId = Request.QueryString["classid"]; string courseId = Request.QueryString["courseid"]; string userId = Request.QueryString["userid"]; string Name = Request.QueryString["Name"]; if (!string.IsNullOrEmpty(questionId)) { JObject jo = new JObject(); jo["questionId"] = questionId; jo["userquestionId"] = userquestionId; jo["companyId"] = companyId; jo["classId"] = classId; jo["courseId"] = courseId; jo["userId"] = userId; jo["Name"] = Name; YsbqcSetting.insertSession(jo); string split = "/"; string path = AppDomain.CurrentDomain.BaseDirectory + split + "Log" + split + YsbqcSetting.getSession().userId; if (!Directory.Exists(path)) { Directory.CreateDirectory(path); } string fileFullPath = path + split + "Session.json"; StringBuilder str = new StringBuilder(); str.Append(JsonConvert.SerializeObject(jo)); StreamWriter sw = System.IO.File.CreateText(fileFullPath); sw.WriteLine(str.ToString()); sw.Close(); string logPath = AppDomain.CurrentDomain.BaseDirectory + split + "Log"; DirectoryInfo[] DIs = Directory.CreateDirectory(logPath).GetDirectories(); foreach (DirectoryInfo DI in DIs) { if (DI.LastAccessTime.Date != DateTime.Now.Date) { DI.Delete(true); } } } string JsonStr = System.IO.File.ReadAllText(context.Server.MapPath("index_login.html")); context.Response.ContentType = "text/html;charset=utf-8"; context.Response.Write(JsonStr); }
// This method gets called by the runtime. Use this method to configure the HTTP request pipeline. public void Configure(IApplicationBuilder app, IHostingEnvironment env, YsbqcSetting set) { //var rewrite = new RewriteOptions().AddRedirect(@"m2/(\w+)", "?m3=$1"); //app.UseRewriter(rewrite); if (env.IsDevelopment()) { app.UseDeveloperExceptionPage(); } else { app.UseExceptionHandler("/Home/Error"); } //MyRewrite(app); var provider = new FileExtensionContentTypeProvider(); provider.Mappings[".jsp"] = "text/html"; app.UseStaticFiles(new StaticFileOptions { ContentTypeProvider = provider }); app.UseCookiePolicy(); app.UseSession(); app.UseMiddleware <SessionMiddleware>(set); app.UseMvc(routes => { routes.MapRoute( name: "default", template: "{controller=Home}/{action=Index}/{id?}"); }); GTXMethod.config = Configuration; GTXMethod.set = ServiceProviderServiceExtensions.GetRequiredService <YsbqcSetting>(app.ApplicationServices); }
public MyController(YsbqcSetting _set) { set = _set; }
public acceptController(IHostingEnvironment _he, IConfiguration _config, YsbqcSetting _set) { he = _he; config = _config; set = _set; }
public sbzx_appsController(YsbqcSetting _is) { this.set = _is; }
public SessionMiddleware(RequestDelegate next, YsbqcSetting _set, IHostingEnvironment _he) { _next = next; set = _set; he = _he; }
public acceptController(YsbqcSetting _set) { set = _set; }
public HomeController(YsbqcSetting _set) { set = _set; }
public bszmController(YsbqcSetting _is) { this.set = _is; }
public jgcxController(YsbqcSetting _is) { this.set = _is; }
public wsbsController(IHostingEnvironment _he, IHttpContextAccessor _hca, YsbqcSetting _set) { he = _he; hca = _hca; set = _set; }
public cwbbdrController(YsbqcSetting _is) { this.set = _is; }
public mainController(IHostingEnvironment _he, YsbqcSetting _set) { he = _he; set = _set; }
public JlueTaxSystemController(YsbqcSetting _is) { this.set = _is; }
public xxmhController(IHostingEnvironment _he, YsbqcSetting _set, Service _ser) { he = _he; set = _set; service = _ser; }
public sbzxController(YsbqcSetting _set) { set = _set; }
public commonController(YsbqcSetting _is) { this.set = _is; }
public tycxController(YsbqcSetting _set, Service _ser) { set = _set; service = _ser; }
public sbzx_apiController(YsbqcSetting _is) { this.set = _is; x = set.getNsrxx(); }
public yhsqcController(YsbqcSetting _is) { this.set = _is; date = set.getGDTXDate(this.GetType()); }
public wsbsController(YsbqcSetting _set) { set = _set; }
public mainController(YsbqcSetting _set) { set = _set; }