Capture the Network Connection Details
I'm writing a code to capture the Newtowrk Connection status:Connected/disconnected; Duration; speed etc.
Can you please help me which Windows inbuild api i can use to do this task?
Will it be the advapi32.dll?
[223 byte] By [
bruce_b] at [2007-11-20 9:53:59]

# 3 Re: Capture the Network Connection Details
Take a look at the Connection part on this page. You will get most of the information from here
http://vbnet.mvps.org/index.html?code/network/index.html
# 5 Re: Capture the Network Connection Details
Thanks I checked in the link there, but nowhere it shows how we can capture the time we have the network connection started.
I had written in my post, that you will get most of the information. Regarding the duration, I am still checking if there is anything available.
# 6 Re: Capture the Network Connection Details
I'm Trying to just pull the last login and logoff time
Finally I made some progress with this... I used the USER_INFO_3 Network management structures, My code looks like this
Private Type USER_INFO_3
usri3_last_logon As Long
usri3_last_logoff As Long
End Type
Private Declare Function NetUserGetInfo Lib "NETAPI32.DLL" _
(ServerName As Any, UserName As Any, _
ByVal Level As Long, _
bufptr As Long) As Long
....
lReturn = NetUserGetInfo(bytPDCName(0), bytUserName(0), 3, bufptr)
If (lReturn = ERROR_SUCCESS) Then
Call RtlMoveMemory(usrinfo, ByVal bufptr, Len(usrinfo))
'-- Get the last logon date --
lReturn = usrinfo.usri3_last_logon
dteLastLogon = DateAdd("s", lReturn, DateSerial(1970, 1, 1) + _
TimeSerial(0, 0, 0))
'-- Get the last logoff date --
lReturn = usrinfo.usri3_last_logoff
dteLastLogoff = DateAdd("s", lReturn, DateSerial(1970, 1, 1) + _
TimeSerial(0, 0, 0))
But I seem to not retrieve the date correctly can someone please help me with this? thanks a lot!!!!