NeedDownList.aspx.cs 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. using SiteCore.Redis;
  2. using System;
  3. using System.Collections.Generic;
  4. using System.Web;
  5. using System.Web.UI;
  6. using System.Web.UI.WebControls;
  7. public partial class NeedDownList : System.Web.UI.Page
  8. {
  9. private void conSuc(string msg)
  10. {
  11. Response.Clear();
  12. Response.ClearContent();
  13. Response.ClearHeaders();
  14. Response.Write("{\"type\":\"success\",\"result\":\"" + msg + "\"}");
  15. //Response.End();
  16. }
  17. private void conErc(string msg)
  18. {
  19. Response.Clear();
  20. Response.ClearContent();
  21. Response.ClearHeaders();
  22. Response.Write("{\"type\":\"error\",\"result\":\"" + msg + "!\"}");
  23. //Response.End();
  24. }
  25. protected void Page_Load(object sender, EventArgs e)
  26. {
  27. if (!IsPostBack)
  28. {
  29. int userId = 0;
  30. if (Request["userid"] != null)
  31. {
  32. userId = Convert.ToInt32(Request["userid"]);
  33. }
  34. if (userId<=0)
  35. {
  36. conErc("缺少必要的参数");
  37. return;
  38. }
  39. string key = "file_client_down_list_" + userId;
  40. string data = erpRedis.RedisHelper.ListRightPop<string>(key);
  41. if (data == null)
  42. data = "";
  43. conSuc(data);
  44. }
  45. }
  46. }