Reputation: 1060
On my computer, the following line:
System.Net.IPAddress result = default(System.Net.IPAddress);
bool success = System.Net.IPAddress.TryParse("234.34.034.004", out result);
creates the following results
What is happening?
Upvotes: 1
Views: 23
Reputation: 6354
It appears that the "34" is being interpreted as octal because it has a leading zero. (The 4 probably also is being interpreted as octal, but its representation is the same in both bases).
34 in octal is 28 in decimal, thus the output.
Upvotes: 1