Welcome To The Home Of The Visual FoxPro Experts  
home. signup. forum. archives. search. google. articles. downloads. faq. members. weblogs. sponsors. rss.
Subject: Small utility to check software users
Thread ID: 199123 Message ID: 199123 # Views: 71 # Ratings: 1
Version: Visual FoxPro 9 SP2 Category: Security and Application Protection
Date: Friday, October 17, 2008 2:10:12 PM         
   


Dear Friends,

I want to share a very small utility to now how many users using your software.

I always create a users??.dbf file in exclusive mode when any user entered.

Now i am using below code to restrict how many users may use my software on Lan.

I hope these codes help beginners.


? "No of Users : "+ltrim(str(usercntchk()))

proc usercntchk
gnDbcnumber=ADIR(gaDatabase, "user*.DBF")
workinguser=0
workingunam=""
for ncount=1 to gndbcnumber
	user_fail=substr(gaDatabase(nCount,1),1,at(".",gaDatabase(nCount,1))-1)
	on error do usercnter
	use &user_fail excl
	on error
	use
endfor
retu workinguser

proc usercnter
on error
if error()=1705
	use &user_fail shar
	workinguser=workinguser+1
	if len(workingunam)=0
		workingunam=alltrim(substr(name,1,at("#",name)-1))
	else
		workingunam=workingunam+","+alltrim(substr(name,1,at("#",name)-1))
	endif
endif


Please also suggest me if you have any other good suggestion.

With regard
Anup Singh
(M.D.)
MARG Compusoft Pvt. Ltd.

Email:anupmarg@gmail.com
Web:www.margcompusoft.com



COMPLETE THREAD
Small utility to check software users Posted by Anup Singh @ 10/17/2008 2:10:12 PM
RE: Small utility to check software users Posted by Borislav Borissov @ 10/17/2008 2:32:27 PM
RE: Small utility to check software users Posted by Anup Singh @ 10/18/2008 7:47:06 AM
RE: Small utility to check software users Posted by tushar @ 10/18/2008 10:11:31 AM
RE: Small utility to check software users Posted by vinod kabdal @ 10/18/2008 7:03:17 AM
RE: Small utility to check software users Posted by Anup Singh @ 10/18/2008 7:45:03 AM
RE: Small utility to check software users Posted by Anil Sharma @ 10/18/2008 9:02:37 AM