stringdelphidelphi-7ip-address

IP Address String Routines in Delphi?


I'm looking for a way in Delphi to validate and manipulate IP Addresses. Some of the things it should be able to do is...

The basic reason is that I want to see if these things are already out there before I go ahead and reinvent them.


Solution

  • I also once wrote a IPv4 and IPv6 conversion unit including a custom variant type for both types of IP addresses. This answer shows a few examples of its capabilities. Originally, it was designed to visualize values of various types in scale on some slider control 1). The requirements then were such that default existing libraries weren't sufficient, but I agree with the comments here that you probably will be helped with just Indy (10!) or alike.

    Answering your list of questions with a few code snippets from that unit:

    For Q1 to Q3 you have to derive some routines yourself, but that should not be any problem.

    1) For those interested, it's this slider control and this topic served as initiation of this unit.