Global.asax.cs 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Web;
  4. using System.Web.Security;
  5. using System.Web.SessionState;
  6. using iNethinkCMS.BLL;
  7. using iNethinkCMS.Command;
  8. namespace iNethinkCMS.Web
  9. {
  10. public class Global : System.Web.HttpApplication
  11. {
  12. private static string _MobilePath = "Mobile/";
  13. /// <summary>
  14. /// 移动手机端模版路径
  15. /// </summary>
  16. public static string MobilePath
  17. {
  18. get { return Global._MobilePath; }
  19. set { Global._MobilePath = value; }
  20. }
  21. protected void Application_Start(object sender, EventArgs e)
  22. {
  23. }
  24. protected void Session_Start(object sender, EventArgs e)
  25. {
  26. }
  27. protected void Application_BeginRequest(object sender, EventArgs e)
  28. {
  29. if (bool.Parse(new BLL_Config().GetModel_SysConfig().StopSQL))
  30. {
  31. string s = "<h3>您提交的信息中含有非法代码!<br>如需继续操作,请与系统管理员联系!</h3>";
  32. if (base.Request.Cookies != null && Command_Security.CookieData())
  33. {
  34. base.Response.Write(s);
  35. base.Response.End();
  36. }
  37. if (base.Request.UrlReferrer != null && Command_Security.referer())
  38. {
  39. base.Response.Write(s);
  40. base.Response.End();
  41. }
  42. if (base.Request.RequestType.ToUpper() == "POST" && Command_Security.PostData())
  43. {
  44. base.Response.Write(s);
  45. base.Response.End();
  46. }
  47. if (base.Request.RequestType.ToUpper() == "GET" && Command_Security.GetData())
  48. {
  49. base.Response.Write(s);
  50. base.Response.End();
  51. }
  52. }
  53. }
  54. protected void Application_AuthenticateRequest(object sender, EventArgs e)
  55. {
  56. }
  57. protected void Application_Error(object sender, EventArgs e)
  58. {
  59. }
  60. protected void Session_End(object sender, EventArgs e)
  61. {
  62. }
  63. protected void Application_End(object sender, EventArgs e)
  64. {
  65. }
  66. }
  67. }