Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Need some specific OS method

Status
Not open for further replies.

Samprayoga

Programmer
Apr 10, 2002
7
FR
Hello,

I would like to have the name of C++ Unix methods that allow to:
- get the system date,
- get the user login name,
- get the IP address,
- get the serial number of the network card,
- get the host ID.

Thanks for help.

S.
 
1. time() and localtime() together will give you the system date (as part of the tm structure returned from localtime).

2. gethostname() will give you the hostname of the system.

3. gethostbyname() returns a hostent structure that includes the address(es) of the host.

4. There is a function to get the username, but I forget what it is.

5. The SERIAL number of a NIC? Well, if it's PCI, there are functions (in Linux at least) that let you read the PCI configuration space...it might be there...
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top