Deploy.aspx.cs 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. using System;
  2. using System.Collections.Generic;
  3. using System.IO;
  4. using System.Web;
  5. using System.Web.UI;
  6. using System.Web.UI.WebControls;
  7. namespace CLIP.eForm.Consent.Web
  8. {
  9. public partial class Deploy : System.Web.UI.Page
  10. {
  11. protected void Page_Load(object sender, EventArgs e)
  12. {
  13. string opCode = Request.QueryString["OP"];
  14. if (string.IsNullOrEmpty(opCode))
  15. {
  16. }
  17. else
  18. {
  19. if (opCode.Equals("GetClientUIFiles"))
  20. {
  21. string clientUIFiles = Server.MapPath("~/App_Data/ClientUIFiles.xml");
  22. string clientUIFilesXml = File.ReadAllText(clientUIFiles);
  23. Response.Write(clientUIFilesXml);
  24. Response.End();
  25. }
  26. else if (opCode.Equals("GetClientUIFilesBasePath"))
  27. {
  28. Response.Write(GetBaseUrl()+"DeployFiles/");
  29. Response.End();
  30. }
  31. }
  32. }
  33. public string GetBaseUrl()
  34. {
  35. var request = HttpContext.Current.Request;
  36. var appUrl = HttpRuntime.AppDomainAppVirtualPath;
  37. if (appUrl != "/") appUrl += "/";
  38. var baseUrl = string.Format("{0}://{1}{2}", request.Url.Scheme, request.Url.Authority, appUrl);
  39. return baseUrl;
  40. }
  41. }
  42. }