views:

385

answers:

2

I have to create a log file for all internet connection made by PC. It should have details of the username, time of connection, etc. I do know about the InternetGetConnectedState() function which returns the bool value. Know how do I get the other details. Can some one help me out thanks in advance. I am using win32 API and visual c++.

+1  A: 

You could use Network List Manager API to get list of networks using IEnumNetworks. Then use INetwork interface to get network information.

Kirill V. Lyadvinsky
A: 

You can use RasEnumConnections to enumerate the current connections. You can then call RasGetLinkStatistics to get information about each link (connection speed, amount of data sent and/or received, time connected, etc.) If you want to know the address assigned to the client on a PPP connection, you have to retrieve that separately with RasGetProjectionInfo. If you want information about the connection (e.g. the name of the modem) you can retrieve that with RasGetConnectStatus.

Jerry Coffin