diff --git a/ln.type/IPv4.cs b/ln.type/IPv4.cs index b6182b8..22da4a0 100644 --- a/ln.type/IPv4.cs +++ b/ln.type/IPv4.cs @@ -1,4 +1,5 @@ using System; +using System.Net; namespace ln.type { @@ -37,7 +38,8 @@ namespace ln.type public static IPv4 operator +(IPv4 ip, int n) => new IPv4((uint)(ip._ip + n)); public static IPv4 operator -(IPv4 ip, int n) => new IPv4((uint)(ip._ip - n)); - - + public static implicit operator IPAddress(IPv4 ipv4) => new IPAddress(ipv4.ToBytes); + public static implicit operator IPv4(IPAddress ipAddress) => new IPv4(ipAddress.GetAddressBytes()); + } } \ No newline at end of file