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 bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

User logged into network?

Status
Not open for further replies.

jeisner

Programmer
Jul 23, 2001
26
AU
I am using NetSend to send a network message out to users from a monitoring program that is always running, but if the user is not logged on currently the message is logged. Does anyone know a method of checking through VFP6 whether a user is logged into the network first so I can only send the message once they are logged on.
 
HI

1. Have a reading of..

How to limit the number of users for an application ?
faq184-1263

2. Create one MyUsers file in the network place. One record for each user with user info. Obviously.. you will have some security file related to user and that can be used.

3. As and when the users log in to the application, the first thing to do is to LOCK his record in this user file in a separate DataEnvironment. This means, MyUser file will remain open with one record locked at startup. This can be done by having a form with this MyUser Table in its data environment (private data environment.) and Form.Visible = .f.

4. Forget about this file.. till the user logs out of application. The QUIT from the application will auto close this.

5. This ensures that the user cannot login from 2 different terminals at the same time.

The thing is that when a system crashes, the record lock automatically gets removed, and the record becomes available. No clean up is required.

Now to find out if a user is loked in.. do a reading of this myUsers file and try to lock the users personal record. If record can be locked.. then the user is not in the system at that moment. Remember to unlock immediately.

Hope this helps :)
ramani :-9
(Subramanian.G),FoxAcc, ramani_g@yahoo.com
 
I have a database of users. In that database is the ip address/ computer name / drive-directory share name

What I do is make a connection to the computer and check for a file (network.txt). If file exist, user is loged on. Else I try to create the file on their hard drive. If successful, user is logged in. If both fail user is not logged in.

Drawback to this method. Every computer has got to be configured with a shared part of their hard drive that anyone can write to. Needless to say it is a subdirectory and I can control all the users on the network. On bootup I have commands in the computer autoexec.bat file to delete all files in that shared directory. This idea might not work in your case. David W. Grewe
Dave@internationalbid.com
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top