Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Determining IP Addresses
Message
De
07/07/2003 14:07:20
Gerry Schmitz
GHS Automation Inc.
Calgary, Alberta, Canada
 
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00806912
Message ID:
00807563
Vues:
19
Get each user to invoke the "WinSock" program when they logon and record their IP address in the "User table" (from "their" session).

>Many Thanks, but every time I run the program from my machine it tells me that the file is being used or not being used BUT the key to this is that it only records my IP address and hostname and the User who has the file opened:
>
>Here is my code: please bare in mind the file that is being accessed is on a shared drive and I am running the program from MY machine.
>
>Lparameters lcFileName
>Local llReturn, lnFID, oIPSocket
> llReturn = .F.
> If File("U:\Profile\User94\InSystem.dbf")
> lnFID = Fopen("U:\Profile\User94\InSystem.dbf", 11)
> If lnFID = -1
> llReturn = .T.
> MESSAGEBOX("User is in System")
> oIPSocket = CreateObject("MSWinsock.Winsock")
> if type('oIPSocket')='O'
> ? oIPSocket.LocalIP
> ? oIPSocket.localhostname
> endif
> Else
> =Fclose(lnFID)
> MESSAGEBOX("User is not in System")
> EndIf
> EndIf
>Return llReturn
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform