什么是Uri.Host和Uri.Authority之间的区别 [英] What's the difference between Uri.Host and Uri.Authority

查看:2395
本文介绍了什么是Uri.Host和Uri.Authority之间的区别的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

的System.Uri 主机授权,和 DnsSafeHost 。 MS提供了当主机 DnsSafeHost 不同的这里

System.Uri has Host, Authority, and DnsSafeHost. MS provides a nice example of when Host and DnsSafeHost are different here.

我想类似的例如,/解释主机授权

I'd like a similar example/explanation for Host and Authority.

推荐答案

是布兰登是绝对正确的,在外行人而言

Yes Brandon is absolutely correct, in layman terms

管理局=主机名+端口号

Authority = Host Name + Port No

和如果URL协议是使用默认端口,比如说端口80用于HTTP URL,则只有在这种情况下,
管理局=主机名(端口号被假定为80),

And if URL protocol is using a default port, say port 80 for http URL, then only in that case Authority = Host Name (Port No is assumed to be 80),

而主机名或者是域名或IP地址

Whereas Host Name is either Domain Name or I.P Address

示例:


  1. http://www.example.com/ 结果
    < BR>
    管理局= www.example.com结果
    主机名= www.example.com

  1. http://www.example.com/

    Authority = www.example.com
    Host Name = www.example.com

http://255.255.255.255:8080/ 结果

管理局= 255.255.255.255:8080结果
主机名称= 255.255.255.255结果

Authority = 255.255.255.255:8080
Host Name = 255.255.255.255

这篇关于什么是Uri.Host和Uri.Authority之间的区别的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆