gpt4 book ai didi

c# - HttpContext.Current.Request.Url.Host 返回不正确的值

转载 作者:行者123 更新时间:2023-11-30 18:41:35 26 4
gpt4 key购买 nike

我的网址是 www.test.com,我尝试通过 HttpContext.Current.Request.Url.Host 获取此网址,但它返回 IP 地址而不是该网址。我通过fiddler检查,它的主机也是IP地址。我想知道如何解决这个问题?

最佳答案

使用下面的代码从代码中获取 url:

string url = HttpContext.Current.Request.Url.ToString().Trim(); 

关于c# - HttpContext.Current.Request.Url.Host 返回不正确的值,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/6673729/

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