You may want to have a look at the nmap project: http://nmap.org/
It's an industry standard on network discovery and troubleshooting and doe exactly what you described (and much, much more).
They have a windows version out as well.
On a sidenote however, network programming is not exactly easy, so you may want to try some other projects first before tackling this one.
If you have any interest in networks then you should definitely learn nmap. It's not really hard, but it is used all over the place. It also very easily can sweep a subnet for hosts and pull all sorts of information from them.