Home All Groups Group Topic Archive Search About

IPAddress.Parse and IPAddress.TryParse Rules

Author
1 Dec 2006 11:54 PM
Ian Lowe
Hi,
Can someone provide a complete set of rules for the IPAddress.Parse
function? The remarks section in the .NET Framework Class Library provides
some of the rules but it appears that .010 for example is interpreted in
Octal. Does this mean that one can mix octal, decimal and hexadecimal octets?

What are the other rules?
Ian

Author
7 Dec 2006 11:56 PM
Peter Ritchie [C# MVP]
In .NET 2.0 IPAddres.Parse and TryParse just delegate to the WinSock function
inet_addr   for IPv4 addresses.  The documentation for inet_addr details what
constitutes a valid IPv4 address:
http://msdn2.microsoft.com/en-us/library/ms738563.aspx

--
Browse http://connect.microsoft.com/VisualStudio/feedback/ and vote.
http://www.peterRitchie.com/blog/
Microsoft MVP, Visual Developer - Visual C#


Show quote
"Ian Lowe" wrote:

> Hi,
> Can someone provide a complete set of rules for the IPAddress.Parse
> function? The remarks section in the .NET Framework Class Library provides
> some of the rules but it appears that .010 for example is interpreted in
> Octal. Does this mean that one can mix octal, decimal and hexadecimal octets?
>
> What are the other rules?
> Ian

AddThis Social Bookmark Button