The API Maze
A reminder to those lost:
The SystemInformation class, containing many useful tidbits of information like the running computer name, number of monitors and whether we're on a network, resides in System.Windows.Forms of all places.
Sure, most of the information there is GDI and Forms related, but why do I need to include and reference this in a console application if all I want is the name of the computer? A more generic SystemInformation should be sitting directly under the System namespace.
VB 2005 has the My namespace for easy access to such information - but this is basic enough to be CLR-wide.
2 Comments
Comments have been disabled for this content.
Jim Arnold said
System.Environment?
Avner Kashtan said
True. Forgot to check there. :)
But still, there isn't a complete overlap in the properties exposed by both, and even when they do overlap they don't neccesarily use the same syntax - System.Windows.Forms.SystemInformation.ComputerName is equivalent to System.Environment.MachineName.