예제 #1
0
 public tycxController(IHostingEnvironment _he, IHttpContextAccessor _hca, YsbqcSetting _set, Service _ser)
 {
     he      = _he;
     hca     = _hca;
     set     = _set;
     service = _ser;
 }
예제 #2
0
        // 摘要:
        //     由自定义 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);
        }
예제 #3
0
        // 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);
        }
예제 #4
0
 public MyController(YsbqcSetting _set)
 {
     set = _set;
 }
예제 #5
0
 public acceptController(IHostingEnvironment _he, IConfiguration _config, YsbqcSetting _set)
 {
     he     = _he;
     config = _config;
     set    = _set;
 }
예제 #6
0
 public sbzx_appsController(YsbqcSetting _is)
 {
     this.set = _is;
 }
예제 #7
0
 public SessionMiddleware(RequestDelegate next, YsbqcSetting _set, IHostingEnvironment _he)
 {
     _next = next;
     set   = _set;
     he    = _he;
 }
예제 #8
0
 public acceptController(YsbqcSetting _set)
 {
     set = _set;
 }
예제 #9
0
 public HomeController(YsbqcSetting _set)
 {
     set = _set;
 }
예제 #10
0
 public bszmController(YsbqcSetting _is)
 {
     this.set = _is;
 }
예제 #11
0
 public jgcxController(YsbqcSetting _is)
 {
     this.set = _is;
 }
예제 #12
0
 public wsbsController(IHostingEnvironment _he, IHttpContextAccessor _hca, YsbqcSetting _set)
 {
     he  = _he;
     hca = _hca;
     set = _set;
 }
예제 #13
0
 public cwbbdrController(YsbqcSetting _is)
 {
     this.set = _is;
 }
예제 #14
0
 public mainController(IHostingEnvironment _he, YsbqcSetting _set)
 {
     he  = _he;
     set = _set;
 }
예제 #15
0
 public JlueTaxSystemController(YsbqcSetting _is)
 {
     this.set = _is;
 }
예제 #16
0
 public xxmhController(IHostingEnvironment _he, YsbqcSetting _set, Service _ser)
 {
     he      = _he;
     set     = _set;
     service = _ser;
 }
예제 #17
0
 public sbzxController(YsbqcSetting _set)
 {
     set = _set;
 }
예제 #18
0
 public commonController(YsbqcSetting _is)
 {
     this.set = _is;
 }
예제 #19
0
 public tycxController(YsbqcSetting _set, Service _ser)
 {
     set     = _set;
     service = _ser;
 }
예제 #20
0
 public sbzx_apiController(YsbqcSetting _is)
 {
     this.set = _is;
     x        = set.getNsrxx();
 }
예제 #21
0
 public yhsqcController(YsbqcSetting _is)
 {
     this.set = _is;
     date     = set.getGDTXDate(this.GetType());
 }
예제 #22
0
 public wsbsController(YsbqcSetting _set)
 {
     set = _set;
 }
예제 #23
0
 public mainController(YsbqcSetting _set)
 {
     set = _set;
 }