Miscellaneous Debris

Avner Kashtan's Frustrations and Exultations
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.

Published Saturday, July 03, 2004 1:57 PM by AvnerK

Filed under:

Comments

# re: The API Maze@ Saturday, July 03, 2004 9:31 AM

System.Environment?

Jim Arnold

# re: The API Maze@ Saturday, July 03, 2004 9:34 AM

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.

Avner Kashtan

Leave a Comment

(required) 
(required) 
(optional)
(required)