Advertisement
If you have a new account but are having problems posting or verifying your account, please email us on hello@boards.ie for help. Thanks :)
Hello all! Please ensure that you are posting a new thread or question in the appropriate forum. The Feedback forum is overwhelmed with questions that are having to be moved elsewhere. If you need help to verify your account contact hello@boards.ie

Convert decimal IP in ASPX

Options
  • 29-01-2007 3: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 Posts: 2,150 ✭✭✭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