How to store and search for an IP Address

前端 未结 7 1378
北海茫月
北海茫月 2021-01-20 02:56

I have the 4 sources of IP addresses , I want to store them in SQL Server and allow the ranges, that can be categorised by the originating country code, to be maked in an E

7条回答
  •  感动是毒
    2021-01-20 03:13

    An IPv6 address can be an eight-byte unsigned integer (an ulong in C#)

    IPv6 addresses are 128-bit (16 byte) not 8 as suggested. I am grappling with this very problem right now for IP ranges.

    I am looking to try padded or hex strings and just do < and > comparisons

提交回复
热议问题