StringExtensionsToIPEndPoint Method |
A string extension method that parses an ip:port pair to IPEndpoint. The method handles
both IPv4 and IPv6.
Namespace: StreamCoders.HelpersAssembly: MediaBase (in MediaBase.dll) Version: 2.0.5.0 (2.0.5.0)
Syntax public static IPEndPoint ToIPEndPoint(
this string endPoint
)
<ExtensionAttribute>
Public Shared Function ToIPEndPoint (
endPoint As String
) As IPEndPoint
public:
[ExtensionAttribute]
static IPEndPoint^ ToIPEndPoint(
String^ endPoint
)
[<ExtensionAttribute>]
static member ToIPEndPoint :
endPoint : string -> IPEndPoint
Parameters
- endPoint
- Type: SystemString
The endpoint to parse. This can be either IPv4 or IPv6.
Return Value
Type:
IPEndPoint
An IPEndPoint instance.
Usage Note
In Visual Basic and C#, you can call this method as an instance method on any object of type
String. When you use instance method syntax to call this method, omit the first parameter. For more information, see
Extension Methods (Visual Basic) or
Extension Methods (C# Programming Guide).
Exceptions Exception | Condition |
---|
FormatException |
Thrown when the format of the parameter is incorrect.
|
See Also