Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Recording IP addresses
Message
From
07/07/2003 08:18:43
 
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00807384
Message ID:
00807394
Views:
17
>Would it be possible to record somebody's IP address if they access a certain file on a shared drive. For example if the user opens the shared file it will record their IP address in a Table. Subsequently if the user closes down the file it removes the ipaddress?
>


Neil, your program will have to record and store the users IP address as and when he enters/exits your application. The following code from www.news2news.com shows how to get the IP address:
DECLARE INTEGER GetAdaptersInfo IN iphlpapi;
STRING @pAdapterInfo, LONG @pOutBufLen

LOCAL lcBuffer, lnBufsize

lnBufsize = 4096
lcBuffer = Repli(Chr(0), lnBufsize)

IF GetAdaptersInfo(@lcBuffer, @lnBufsize) = 0
? "Current IP address:", STRTRAN(SUBSTR(lcBuffer, 433,15), Chr(0),"")
? "Gateway:", STRTRAN(SUBSTR(lcBuffer, 473,15), Chr(0),'')
ENDIF
In the End, we will remember not the words of our enemies, but the silence of our friends - Martin Luther King, Jr.
Previous
Reply
Map
View

Click here to load this message in the networking platform