473,324 Members | 2,400 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,324 software developers and data experts.

IPAddress.Address is obsolete

Does anyone know why this property is obsolete? Also, is there an
alternative available?
Jul 21 '05 #1
10 6716

"Michael Riggio" <mi************@unisys.nospam.com> wrote in message
news:eY**************@TK2MSFTNGP11.phx.gbl...
Does anyone know why this property is obsolete? Not specifically, but usually it's b/c they build in new funcionality and
the obsolete stuff no longer works due to a change in a dependency or
doesn't fit in the model. I'll see if I can get you a real answer to this
one b/c this is just a guess on my part
Also, is there an alternative available? Something like this:

Dim Ip_Address As IPHostEntry = Dns.Resolve("205.128.215.120")

MessageBox.Show(Ip_Address.HostName)


Jul 21 '05 #2
Thanks for taking the time to perform a test or two for me. Also,
concerning your alternative:
IPHostEntry contains a collection of IPAddress objects, so I think I'm soft
of in the same situation. The application I'm working on needs to display
the list of ipaddresses for each hostname, so I would definitely need to
iterate through that collection..

"William Ryan eMVP" <do********@comcast.nospam.net> wrote in message
news:ew**************@TK2MSFTNGP10.phx.gbl...

"Michael Riggio" <mi************@unisys.nospam.com> wrote in message
news:eY**************@TK2MSFTNGP11.phx.gbl...
Does anyone know why this property is obsolete?

Not specifically, but usually it's b/c they build in new funcionality and
the obsolete stuff no longer works due to a change in a dependency or
doesn't fit in the model. I'll see if I can get you a real answer to this
one b/c this is just a guess on my part
Also, is there an
alternative available?

Something like this:

Dim Ip_Address As IPHostEntry = Dns.Resolve("205.128.215.120")

MessageBox.Show(Ip_Address.HostName)



Jul 21 '05 #3
Ooops

For Each add As IPAddress In Ip_Address.AddressList

Next

"Michael Riggio" <mi************@unisys.nospam.com> wrote in message
news:Of**************@tk2msftngp13.phx.gbl...
Thanks for taking the time to perform a test or two for me. Also,
concerning your alternative:
IPHostEntry contains a collection of IPAddress objects, so I think I'm soft of in the same situation. The application I'm working on needs to display
the list of ipaddresses for each hostname, so I would definitely need to
iterate through that collection..

"William Ryan eMVP" <do********@comcast.nospam.net> wrote in message
news:ew**************@TK2MSFTNGP10.phx.gbl...

"Michael Riggio" <mi************@unisys.nospam.com> wrote in message
news:eY**************@TK2MSFTNGP11.phx.gbl...
Does anyone know why this property is obsolete?

Not specifically, but usually it's b/c they build in new funcionality and the obsolete stuff no longer works due to a change in a dependency or
doesn't fit in the model. I'll see if I can get you a real answer to this one b/c this is just a guess on my part
Also, is there an
alternative available?

Something like this:

Dim Ip_Address As IPHostEntry = Dns.Resolve("205.128.215.120")

MessageBox.Show(Ip_Address.HostName)




Jul 21 '05 #4
Michael:

I wish I knew a better answer but I'm a relative newbie to network
programming.

This will walk you through it though:

"Michael Riggio" <mi************@unisys.nospam.com> wrote in message
news:Of**************@tk2msftngp13.phx.gbl...
Thanks for taking the time to perform a test or two for me. Also,
concerning your alternative:
IPHostEntry contains a collection of IPAddress objects, so I think I'm soft of in the same situation. The application I'm working on needs to display
the list of ipaddresses for each hostname, so I would definitely need to
iterate through that collection..

"William Ryan eMVP" <do********@comcast.nospam.net> wrote in message
news:ew**************@TK2MSFTNGP10.phx.gbl...

"Michael Riggio" <mi************@unisys.nospam.com> wrote in message
news:eY**************@TK2MSFTNGP11.phx.gbl...
Does anyone know why this property is obsolete?

Not specifically, but usually it's b/c they build in new funcionality and the obsolete stuff no longer works due to a change in a dependency or
doesn't fit in the model. I'll see if I can get you a real answer to this one b/c this is just a guess on my part
Also, is there an
alternative available?

Something like this:

Dim Ip_Address As IPHostEntry = Dns.Resolve("205.128.215.120")

MessageBox.Show(Ip_Address.HostName)




Jul 21 '05 #5

"Michael Riggio" <mi************@unisys.nospam.com> wrote in message
news:eY**************@TK2MSFTNGP11.phx.gbl...
Does anyone know why this property is obsolete? Also, is there an
alternative available?


Docs say to use the GetAddressBytes method to get the address as binary
data. You should also be able to use IPAddress.ToString to get the address
in a textual notation.
Jul 21 '05 #6
Michael,
In addition to the other's comments:

My understanding is IPAddress.Address is obsolete as it does not support
IPv6. (internet addresses longer then 32bits).

As Daniel suggested, the GetAddressBytes call supports addresses longer then
32bits!

Hope this helps
Jay

"Michael Riggio" <mi************@unisys.nospam.com> wrote in message
news:eY**************@TK2MSFTNGP11.phx.gbl...
Does anyone know why this property is obsolete? Also, is there an
alternative available?

Jul 21 '05 #7
Here is a tool I call IPLookup I wrote in .NET (console app) that should
show you how to use the IP lookup stuff...

Imports System.Net
Imports System.Net.Sockets
Imports System.Reflection.Assembly

Module modCore
Sub Main(ByVal cmdArgs() As String)

Dim iTotalParms As Integer = 0
iTotalParms = (UBound(cmdArgs) + 1)

Console.WriteLine("{0} {1}.{2}.{3} Copyright (C) 2004 Joseph N.
Stackhouse", _
GetExecutingAssembly.GetName.Name, _
GetExecutingAssembly.GetName().Version.Major.ToStr ing(), _
GetExecutingAssembly.GetName().Version.Minor.ToStr ing(), _
GetExecutingAssembly.GetName().Version.Build.ToStr ing())

Console.WriteLine()

If (iTotalParms) <> 1 Then
Console.WriteLine("Usage: {0} <hostname>",
GetExecutingAssembly.GetName.Name)
End
End If

Dim iTotalResults As Integer = 0
Dim sIPs() As String
Dim sNames() As String

Dim DNSLookup As Dns
Dim HostLookup As Dns

Dim IPResult As New IPHostEntry

Try
IPResult = DNSLookup.GetHostByName(cmdArgs(0))
Catch ex As SocketException
Console.WriteLine("Could not resolve [{0}]:", cmdArgs(0))
Console.WriteLine()
Console.WriteLine(ex.Message)
End
Catch ex As System.ArgumentOutOfRangeException
Console.WriteLine("Cannot process your request as one or more
segments of the address you specified exceed the maximum length allowed")
End
End Try

iTotalResults = UBound(IPResult.AddressList)

Console.WriteLine("Found a total of {0} addresses for [{1}]:",
(iTotalResults + 1).ToString, cmdArgs(0))
Console.WriteLine()

ReDim sIPs(iTotalResults)
ReDim sNames(iTotalResults)

Dim i As Integer = 0

Do While i <= UBound(IPResult.AddressList)
sIPs(i) = (IPResult.AddressList(i).ToString())

Try
sNames(i) =
HostLookup.GetHostByAddress(sIPs(i)).HostName.ToSt ring
Catch ex As Sockets.SocketException
If sNames(i) = vbNullString Then sNames(i) = "none"
End Try

Console.WriteLine("{0}.{1}{2}{3}({4})", (i + 1).ToString, vbTab,
sIPs(i), vbTab, sNames(i))
i += 1
Loop

End Sub
End Module

Alternatively you can download it from Planet Source Code at:

http://www.pscode.com/vb/scripts/Sho...txtCodeId=1287

-L
"Jay B. Harlow [MVP - Outlook]" <Ja************@msn.com> wrote in message
news:uk**************@TK2MSFTNGP12.phx.gbl...
Michael,
In addition to the other's comments:

My understanding is IPAddress.Address is obsolete as it does not support
IPv6. (internet addresses longer then 32bits).

As Daniel suggested, the GetAddressBytes call supports addresses longer then 32bits!

Hope this helps
Jay

"Michael Riggio" <mi************@unisys.nospam.com> wrote in message
news:eY**************@TK2MSFTNGP11.phx.gbl...
Does anyone know why this property is obsolete? Also, is there an
alternative available?


Jul 21 '05 #8
Hi Jay,
So, the IPAddress type will support IPv6, but the Address property
doesn't. To get around that you're suggesting using the
IPAddress.GetAddressBytes method? So, in theory, I could derive from
IPAddress and include my own Address property that supports IPv6, and
everyone would be happy?

Thanks!
-Michael

"Jay B. Harlow [MVP - Outlook]" <Ja************@msn.com> wrote in message
news:uk**************@TK2MSFTNGP12.phx.gbl...
Michael,
In addition to the other's comments:

My understanding is IPAddress.Address is obsolete as it does not support
IPv6. (internet addresses longer then 32bits).

As Daniel suggested, the GetAddressBytes call supports addresses longer then 32bits!

Hope this helps
Jay

"Michael Riggio" <mi************@unisys.nospam.com> wrote in message
news:eY**************@TK2MSFTNGP11.phx.gbl...
Does anyone know why this property is obsolete? Also, is there an
alternative available?


Jul 21 '05 #9

"Michael Riggio" <mi************@unisys.nospam.com> wrote in message
news:OH**************@TK2MSFTNGP12.phx.gbl...
Hi Jay,
So, the IPAddress type will support IPv6, but the Address property
doesn't. To get around that you're suggesting using the
IPAddress.GetAddressBytes method? So, in theory, I could derive from
IPAddress and include my own Address property that supports IPv6, and
everyone would be happy?
Only until a new address format comes around or you have someone who needs
to deal with both without knowing which he's handling.

Keeping everyone happy is about as easy as counting the sand in the sahara
using nothing but a hippo and three bananas.

Thanks!
-Michael

"Jay B. Harlow [MVP - Outlook]" <Ja************@msn.com> wrote in message
news:uk**************@TK2MSFTNGP12.phx.gbl...
Michael,
In addition to the other's comments:

My understanding is IPAddress.Address is obsolete as it does not support
IPv6. (internet addresses longer then 32bits).

As Daniel suggested, the GetAddressBytes call supports addresses longer

then
32bits!

Hope this helps
Jay

"Michael Riggio" <mi************@unisys.nospam.com> wrote in message
news:eY**************@TK2MSFTNGP11.phx.gbl...
> Does anyone know why this property is obsolete? Also, is there an
> alternative available?
>
>



Jul 21 '05 #10
Michael,
What would your address property provide that is not provided by
GetAddressBytes?

The "problem" with your theory is that Address is not overridable & to
change what it returns you would need to "shadow" it anyway (new in C#),
once you "shadow" it, the property will not function polymorphically, if I
assign one of your DerivedIPAddress objects to an IPAddress variable, the
normal Address property will be exposed...

I'm happy using IPAddress.GetAddressBytes or IPAddress.ToString.

Hope this helps
Jay
"Michael Riggio" <mi************@unisys.nospam.com> wrote in message
news:OH**************@TK2MSFTNGP12.phx.gbl...
Hi Jay,
So, the IPAddress type will support IPv6, but the Address property
doesn't. To get around that you're suggesting using the
IPAddress.GetAddressBytes method? So, in theory, I could derive from
IPAddress and include my own Address property that supports IPv6, and
everyone would be happy?

Thanks!
-Michael

"Jay B. Harlow [MVP - Outlook]" <Ja************@msn.com> wrote in message
news:uk**************@TK2MSFTNGP12.phx.gbl...
Michael,
In addition to the other's comments:

My understanding is IPAddress.Address is obsolete as it does not support
IPv6. (internet addresses longer then 32bits).

As Daniel suggested, the GetAddressBytes call supports addresses longer

then
32bits!

Hope this helps
Jay

"Michael Riggio" <mi************@unisys.nospam.com> wrote in message
news:eY**************@TK2MSFTNGP11.phx.gbl...
Does anyone know why this property is obsolete? Also, is there an
alternative available?



Jul 21 '05 #11

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Grandma Wilkerson | last post by:
Hi, This is your grandmother. I'm have a situation where I have access to an IPAddress and a mask and need to determine if another IP address is included in the IP block specified by former...
5
by: Stuart Norris | last post by:
Dear Readers, I am attempting to define an array of IPAddress-es in C#. I wish to have a array of address so I can try in order to connect to them in a loop to handle unavailable hosts. ...
10
by: Michael Riggio | last post by:
Does anyone know why this property is obsolete? Also, is there an alternative available?
4
by: Jerry Spence1 | last post by:
How do I convert "192.168.0.200" (as type string) to MyIP (as type IPAddress)? -Jerry
2
by: Ryan Liu | last post by:
Hi, Can someone tell me how to calculate an IPaddress's long value? I have an application which lisiten on a port using UDP protocol. There could be multiple client sendind UDP data to it and...
1
by: =?Utf-8?B?Sm9hY2hpbQ==?= | last post by:
How might I serialize an IPAddress? I read it needs to have a default constructor so I made a wrapper class: public class IPAddressEx : IPAddress { public IPAddressEx() : base(...
2
by: Mr Gray | last post by:
Hello, I am trying to find a newer way of implementing the following but I am unsuccessful thus far: private void SetDataPort(IPEndPoint ep) { byte hostBytes =...
3
by: KBJ | last post by:
Hi, How can I get IP address of client, which sends request to server via .net remoting? Regards, Kate
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.