Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/csharp/286.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/asp.net/33.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C# 如何从asp.net获取主机域_C#_Asp.net - Fatal编程技术网

C# 如何从asp.net获取主机域

C# 如何从asp.net获取主机域,c#,asp.net,C#,Asp.net,我试图通过使用Request.Url.Host方法获得一个第四级域,但它似乎没有达到目的 如果域名是“abc.def.somedomain.com”,它只会返回到第三级“def.somedomain.com”我相信Request.Url.GetLeftPart(UriPartial.Authority)就是你需要的。我相信Request.Url.GetLeftPart(UriPartial.Authority)就是你需要的。你看过“Authority”吗属性?检查使用请求的请求的http头。头您

我试图通过使用Request.Url.Host方法获得一个第四级域,但它似乎没有达到目的


如果域名是“abc.def.somedomain.com”,它只会返回到第三级“def.somedomain.com”

我相信
Request.Url.GetLeftPart(UriPartial.Authority)
就是你需要的。

我相信
Request.Url.GetLeftPart(UriPartial.Authority)
就是你需要的。

你看过“Authority”吗属性?检查使用请求的请求的http头。头您可能会找到完整的域名。查看“Authority”属性了吗?检查使用请求的请求的http头。头您可能会找到完整的域名