gpt4 book ai didi

c# - HttpContext.Current.Request.Url 给出 127.0.0.1

转载 作者:太空狗 更新时间:2023-10-30 00:24:49 27 4
gpt4 key购买 nike

在运行在以下 URL http://localhost:39452/ 的 Visual Studio 中调试时我得到 http://127.0.0.1 作为以下属性的值

 HttpContext.Current.Request.Url

代替 http://localhost:39452/我的主机文件中有这个值:

::1  localhost

你能告诉我我在这里做错了什么吗?

最佳答案

也许您试图过早获取 HttpContext.Current.Request.Url 值。

例如;在 HttpModuleInit 事件期间,您可能会遇到这类问题。我的意思是您可能会得到 http://127.0.0.1/myApp 而不是 http://localhost/myApp 的正确值。

关于c# - HttpContext.Current.Request.Url 给出 127.0.0.1,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/21436431/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com