So I'm teaching myself C# and like to just start learning by doing sort of person and asking questions when I get stuck. I've done some C in the past some I'm familiar with procedural programming a little bit.
So I decided to write an app to retrieve some network information and do some things with it. I'm stuck on getting the subnet mask for my PC and not understanding some this. What I'm guessing is inheritance but I'm just starting to learn OO stuff so not sure.
So C# has a class UnicastIPAddressInformation with a property IPv4Mask that MSDN says gets the IPv4 mask (good!, that's what I want!) and returns an IPAddress object. I'm sure these are pretty easy questions so I apologize but I'm confused why it returns an IPAddress object as opposed to a UnicastIPAddressInformation object and then when I look at the UnicastIPAddressInformation Class it says "You do not create instances of this class; instances are returned in the array returned by the UnicastAddresses property."
Any and all help is greatly appreciated and instead of here's how to do it, I'd appreciate explanation of how to and why. Thanks.
So I decided to write an app to retrieve some network information and do some things with it. I'm stuck on getting the subnet mask for my PC and not understanding some this. What I'm guessing is inheritance but I'm just starting to learn OO stuff so not sure.
So C# has a class UnicastIPAddressInformation with a property IPv4Mask that MSDN says gets the IPv4 mask (good!, that's what I want!) and returns an IPAddress object. I'm sure these are pretty easy questions so I apologize but I'm confused why it returns an IPAddress object as opposed to a UnicastIPAddressInformation object and then when I look at the UnicastIPAddressInformation Class it says "You do not create instances of this class; instances are returned in the array returned by the UnicastAddresses property."
Any and all help is greatly appreciated and instead of here's how to do it, I'd appreciate explanation of how to and why. Thanks.
