Welcome To The Home Of The Visual FoxPro Experts  
home. signup. forum. archives. search. google. articles. downloads. faq. members. weblogs. sponsors. rss.
 From: vinod kabdal
  Where is vinod kabdal?
 Delhi
 India
 vinod kabdal
 To: Anup Singh
  Where is Anup Singh?
 Delhi
 India
 Anup Singh
 Tags
Subject: RE: Small utility to check software users
Thread ID: 199123 Message ID: 199189 # Views: 40 # Ratings: 0
Version: Visual FoxPro 9 SP2 Category: Security and Application Protection
Date: Saturday, October 18, 2008 7:03:17 AM         
   


> 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

Hi Anup Singh,
Use this command in main prgfile then you can find RecC() in User Dbf that user are use this program.

USE netuser IN 0 SHARED ALIAS netuser
GO TOP
INSERT INTO netuser(username, dt_time) VALUES(ALLTRIM(SYS(0)), DATETIME())

at return time use this code. && For Delete user from Dbf
SELECT netuser
GO TOP
DELETE FOR ALLTRIM(username)=ALLTRIM(SYS(0))


Thanks

Vinod Kabdal



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