一款简单易用的基础网络通讯组件库。

IPHost 类

IP解析映射

Definition

命名空间: TouchSocket.Sockets
程序集: TouchSocket (在 TouchSocket.dll 中) 版本:3.0.0+ccaf96084d09f972257496d1dd63b8ba3c1e44f0
C#
public class IPHost : Uri
Inheritance
Object    Uri    IPHost

构造函数

IPHost(Int32) 从端口号创建IPv4的Any地址。
IPHost(String) IP解析映射

支持端口,ip,域名等。具体格式如下:

  • 端口:直接按Int32入参,该操作一般在监听时使用。
  • IPv4:按"127.0.0.1:7789"入参。
  • IPv6:按"[*::*]:7789"入参。
  • 域名(1):"tcp://127.0.0.1:7789"
  • 域名(2):"tcp://[*::*]:7789"
  • 域名(3):"http://touchsocket.net"
  • 域名(4):"http://touchsocket.net:7789"

IPHost(IPAddress, Int32)IPAddress

属性

AbsolutePathGets the absolute path of the URI.
(继承自 Uri。)
AbsoluteUriGets the absolute URI.
(继承自 Uri。)
AuthorityGets the Domain Name System (DNS) host name or IP address and the port number for a server.
(继承自 Uri。)
DnsSafeHostGets a host name that, after being unescaped if necessary, is safe to use for DNS resolution.
(继承自 Uri。)
EndPoint 获取终结点。
FragmentGets the escaped URI fragment.
(继承自 Uri。)
HostGets the host component of this instance.
(继承自 Uri。)
HostNameTypeGets the type of the host name specified in the URI.
(继承自 Uri。)
IdnHostGets the RFC 3490 compliant International Domain Name of the host, using Punycode as appropriate. This string, after being unescaped if necessary, is safe to use for DNS resolution.
(继承自 Uri。)
IsAbsoluteUriGets a value that indicates whether the Uri instance is absolute.
(继承自 Uri。)
IsDefaultPortGets a value that indicates whether the port value of the URI is the default for this scheme.
(继承自 Uri。)
IsFileGets a value that indicates whether the specified Uri is a file URI.
(继承自 Uri。)
IsLoopbackGets a value that indicates whether the specified Uri references the local host.
(继承自 Uri。)
IsUncGets a value that indicates whether the specified Uri is a universal naming convention (UNC) path.
(继承自 Uri。)
LocalPathGets a local operating-system representation of a file name.
(继承自 Uri。)
OriginalStringGets the original URI string that was passed to the Uri constructor.
(继承自 Uri。)
PathAndQueryGets the AbsolutePath and Query properties separated by a question mark (?).
(继承自 Uri。)
Port 端口号
QueryGets any query information included in the specified URI.
(继承自 Uri。)
SchemeGets the scheme name for this URI.
(继承自 Uri。)
SegmentsGets an array containing the path segments that make up the specified URI.
(继承自 Uri。)
UserEscapedGets a value that indicates whether the URI string was completely escaped before the Uri instance was created.
(继承自 Uri。)
UserInfoGets the user name, password, or other user-specific information associated with the specified URI.
(继承自 Uri。)

方法

CanonicalizeConverts the internally stored URI to canonical form.
(继承自 Uri。)
已过时。
CheckSecurityCalling this method has no effect.
(继承自 Uri。)
已过时。
EqualsCompares two Uri instances for equality.
(继承自 Uri。)
EscapeConverts any unsafe or reserved characters in the path component to their hexadecimal character representations.
(继承自 Uri。)
已过时。
FinalizeAllows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection.
(继承自 Object。)
GetComponentsGets the specified components of the current instance using the specified escaping for special characters.
(继承自 Uri。)
GetHashCodeGets the hash code for the URI.
(继承自 Uri。)
GetLeftPartGets the specified portion of a Uri instance.
(继承自 Uri。)
GetObjectDataReturns the data needed to serialize the current instance.
(继承自 Uri。)
GetTypeGets the Type of the current instance.
(继承自 Object。)
IsBadFileSystemCharacterIndicates whether a character is invalid in a file system name.
(继承自 Uri。)
已过时。
IsBaseOfDetermines whether the current Uri instance is a base of the specified Uri instance.
(继承自 Uri。)
IsReservedCharacterDetermines whether the specified character is a reserved character.
(继承自 Uri。)
已过时。
IsWellFormedOriginalStringIndicates whether the string used to construct this Uri was well-formed and does not require further escaping.
(继承自 Uri。)
MakeRelativeDetermines the difference between two Uri instances.
(继承自 Uri。)
已过时。
MakeRelativeUriDetermines the difference between two Uri instances.
(继承自 Uri。)
MemberwiseCloneCreates a shallow copy of the current Object.
(继承自 Object。)
ParseParses the URI of the current instance to ensure it contains all the parts required for a valid URI.
(继承自 Uri。)
已过时。
ParseIPHosts 解析一个组的地址。
ToStringGets a canonical string representation for the specified Uri instance.
(继承自 Uri。)
UnescapeConverts the specified string by replacing any escape sequences with their unescaped representation.
(继承自 Uri。)
已过时。

运算符

(Int32 to IPHost) 由端口向IPHost转换
(String to IPHost) 由字符串向IPHost转换

扩展方法

Map
(由 Mapper 定义。)
Map
(由 Mapper 定义。)
MapTTarget
(由 Mapper 定义。)
ToJsonString 转换为Json
(由 SerializeConvert 定义。)

显式接口实现

ISerializableGetObjectDataReturns the data needed to serialize the current instance.
(继承自 Uri。)

参见