我继承了一堆$ C $下一个web应用程序,其中包含的硬codeD路径不减当年。我一直在负责试图让它使用https运行://。
I've inherited a pile of code for a web app which contains oodles of hard-coded paths. I've been tasked with trying to get it to run using https://.
除了检测https://开头?在URL中是否有更多的带内方法来检测当前上下文为https
Other than detecting "https://" in the URL is there a more inband way to detect that the current context is https?
寻找这样的:
System.Web.HttpContext.Current.Request.Url。 Protocol.ToString()的
System.Web.HttpContext.Current.Request.Url.Protocol.ToString()
您可以使用 HttpContext.Current.Request.IsSecureConnection