Welcome To The Home Of The Visual FoxPro Experts  
home. signup. forum. archives. search. google. articles. downloads. faq. members. weblogs. file info. rss.
 From: Anil Sharma
  Where is Anil Sharma?
 ludhiana
 India
 Anil Sharma
 To: Jun Tangunan
  Where is Jun Tangunan?
 Cabanatuan
 Philippines
 Jun Tangunan
 Tags
Subject: RE: how to stop user from Re-Login
Thread ID: 330907 Message ID: 331132 # Views: 33 # Ratings: 1
Version: Visual FoxPro 9 SP2 Category: Projects and Design
Date: Tuesday, December 27, 2011 8:40:33 AM         
   


> >
> > use fcreate() function to create a file with the name of user. and leave it open when software starts
> > so when a user tried to open it again from same user name it will not allow until the software is closed.
> > you can give a unique extensions to those files and and just put those files in array and try to open then
> > count the files which are not opening is equal to users who are using the software.
> >
> >
> > Anil
> >
> >
> > Accounting Software
> >
> > Web Development
> >
> > Accounting, Inventory, Hotel Management, Restaurant Kot Billing, MLM, Excise Accounting and much much more!.
> > My Blog
>
> Anil,
>
> I asked Stef below and I will also ask you here. How does FCREATE() solve the issue of improper shutdown without the need to restart the unit acting as a server, without resorting to external apps aside from your own app?
>
> http://sandstorm36.blogspot.com
> http://weblogs.foxite.com/sandstorm36/default.aspx

this is vfp help example. Its more than sufficient.
run this prg on one vfp instance.
and without closing vfp open another instance. you will see you get -1 in return which means user is logged in already.
now close the 1st vfp instance. and run again this prg in 2nd instance now you will get the value. so if software close
becaz. of improper shutdown file lock will free.



IF FILE('errors.txt') && Does file exist?

gnErrFile = FOPEN('errors.txt',12) && If so, open read/write
ELSE
gnErrFile = FCREATE('errors.txt') && If not create it
ENDIF

=messagebox(gnErrFile)

Anil


Accounting Software

Web Development

Accounting, Inventory, Hotel Management, Restaurant Kot Billing, MLM, Excise Accounting and much much more!.
My Blog

ENTIRE THREAD

how to stop user from Re-Login Posted by mk sharma @ 12/24/2011 11:22:10 AM
RE: how to stop user from Re-Login Posted by Vivek Deodhar @ 12/24/2011 12:20:24 PM
RE: how to stop user from Re-Login Posted by mk sharma @ 12/24/2011 12:31:54 PM
RE: how to stop user from Re-Login Posted by Jun Tangunan @ 12/26/2011 3:27:48 AM
RE: how to stop user from Re-Login Posted by mk sharma @ 12/26/2011 7:13:14 AM
RE: how to stop user from Re-Login Posted by Stefan Wuebbe @ 12/26/2011 10:43:52 AM
RE: how to stop user from Re-Login Posted by mk sharma @ 12/26/2011 12:04:10 PM
RE: how to stop user from Re-Login Posted by Anil Sharma @ 12/26/2011 12:09:51 PM
RE: how to stop user from Re-Login Posted by mk sharma @ 12/26/2011 12:23:46 PM
RE: how to stop user from Re-Login Posted by Jun Tangunan @ 12/27/2011 5:56:27 AM
RE: how to stop user from Re-Login Posted by Anil Sharma @ 12/27/2011 8:40:33 AM
RE: how to stop user from Re-Login Posted by Jun Tangunan @ 12/27/2011 11:30:17 PM
RE: how to stop user from Re-Login Posted by Stefan Wuebbe @ 12/26/2011 6:29:48 PM
RE: how to stop user from Re-Login Posted by Jun Tangunan @ 12/27/2011 5:34:38 AM
RE: how to stop user from Re-Login Posted by Stefan Wuebbe @ 12/27/2011 10:10:50 AM
RE: how to stop user from Re-Login Posted by Vivek Deodhar @ 12/27/2011 10:37:58 AM
RE: how to stop user from Re-Login Posted by Jun Tangunan @ 12/27/2011 11:27:56 PM
RE: how to stop user from Re-Login Posted by Jun Tangunan @ 12/27/2011 11:19:20 PM
RE: how to stop user from Re-Login Posted by anand kulkarni @ 12/26/2011 3:57:11 AM
RE: how to stop user from Re-Login Posted by Stefan Wuebbe @ 12/26/2011 10:38:35 AM
RE: how to stop user from Re-Login Posted by mk sharma @ 12/26/2011 12:02:01 PM