HttpHelper.cs 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Collections.Specialized;
  4. using System.Linq;
  5. using System.Text;
  6. using System.Web;
  7. using Bowin.Common;
  8. namespace EMIS.Utility
  9. {
  10. public class HttpHelper
  11. {
  12. public static string GetMenuNo()
  13. {
  14. try
  15. {
  16. var menuNo = HttpContext.Current.Request["MNU"];
  17. if (string.IsNullOrEmpty(menuNo))
  18. {
  19. menuNo = HttpContext.Current.Request.UrlReferrer.GetQueryStringByPath("MNU");
  20. }
  21. return menuNo;
  22. }
  23. catch
  24. {
  25. return "WINFORM";
  26. }
  27. }
  28. public static SortedDictionary<string, string> GetRequestPost()
  29. {
  30. int i = 0;
  31. SortedDictionary<string, string> sArray = new SortedDictionary<string, string>();
  32. NameValueCollection coll;
  33. //Load Form variables into NameValueCollection variable.
  34. coll = HttpContext.Current.Request.Form;
  35. // Get names of all forms into a string array.
  36. String[] requestItem = coll.AllKeys;
  37. for (i = 0; i < requestItem.Length; i++)
  38. {
  39. sArray.Add(requestItem[i], HttpContext.Current.Request.Form[requestItem[i]]);
  40. }
  41. return sArray;
  42. }
  43. }
  44. }