Getting System Information

31 12 2008

We could use the following function to get the information that describes the system configuration.

GetComputerName, GetUserName, GetSystemDirectory and GetWindowsDirectory.

Please check the code below,

void GetSystemInfos()
{
   
#define INFO_BUFFER_SIZE 32767
   
   TCHAR  infoBuf[INFO_BUFFER_SIZE];
   DWORD  bufCharCount = INFO_BUFFER_SIZE;
   
   // Get and display the name of the computer.
   GetComputerName(infoBuf, &bufCharCount );   
   
   bufCharCount = INFO_BUFFER_SIZE;
   
   // Get and display the user name.
   GetUserName( infoBuf, &bufCharCount ) ;
  
   // Get and display the system directory.
   GetSystemDirectory( infoBuf, INFO_BUFFER_SIZE );
   
   // Get and display the Windows directory.
   GetWindowsDirectory( infoBuf, INFO_BUFFER_SIZE );
   
}
Advertisements

Actions

Information

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s




%d bloggers like this: