Advertisement
Help Keep Boards Alive. Support us by going ad free today. See here: https://subscriptions.boards.ie/.
If we do not hit our goal we will be forced to close the site.

Current status: https://keepboardsalive.com/

Annual subs are best for most impact. If you are still undecided on going Ad Free - you can also donate using the Paypal Donate option. All contribution helps. Thank you.
https://www.boards.ie/group/1878-subscribers-forum

Private Group for paid up members of Boards.ie. Join the club.

Convert decimal IP in ASPX

  • 29-01-2007 03:25PM
    #1
    Closed Accounts Posts: 1,974 ✭✭✭


    Hi there,

    Does anybody would be kind enough to give me an ASPX snipet to convert the result of a SQL query that will return this type of value :
    2130706433

    I need to implement a small converter in my ASPX script that will calculate the real value of the IP address and will actually give me, here for instance with the example given up, 127.0.0.1

    Thanks for your help.


Comments

  • Registered Users, Registered Users 2 Posts: 2,157 ✭✭✭dazberry


    In ASP.NET 2.0 you could do something like:

    long Address = IPAddress.HostToNetworkOrder(2130706433);
    IPEndPoint EndPoint = new IPEndPoint(Address,0);
    EndPoint.Address.ToString(); // = "127.0.0.1"

    D.


  • Closed Accounts Posts: 1,974 ✭✭✭mick.fr


    Thanks I appreciate.


Advertisement