1. Anoop Anand
  2. PowerBuilder
  3. Tuesday, 5 October 2021 15:33 PM UTC

How to restrict multiple logins from same pc?

Accepted Answer
Roland Smith Accepted Answer Pending Moderation
  1. Tuesday, 5 October 2021 16:31 PM UTC
  2. PowerBuilder
  3. # Permalink

You can block multiple copies of your app on the same computer using a mutex:

https://www.topwizprogramming.com/freecode_mutex.html

 

Comment
  1. Anoop Anand
  2. Wednesday, 6 October 2021 13:22 PM UTC
Thanks a lot Roland, this worked.
  1. Helpful
There are no comments made yet.
Chris Pollach @Appeon Accepted Answer Pending Moderation
  1. Tuesday, 5 October 2021 15:40 PM UTC
  2. PowerBuilder
  3. # 1

Hi Anoop;

  Do you mean to the DBMS? If so and for example your using SQL Server - try the SP_Who stored procedure to check if the user is logged into the DB Server.

Regards ... Chris

Comment
  1. Anoop Anand
  2. Tuesday, 5 October 2021 17:05 PM UTC
Nope, through the Executable, sorry I should have been clearer the first time.
  1. Helpful
  1. Chris Pollach @Appeon
  2. Tuesday, 5 October 2021 17:14 PM UTC
Then using the Mutex SDK calls would be the key for the client side ...

FUNCTION uLong CreateMutex ( uLong lpMutexAttributes, Boolean bInitialOwner, ref string lpName ) LIBRARY "KERNEL32.dll" ALIAS FOR CreateMutexW

FUNCTION Boolean ReleaseMutex ( uLong ulMutexHandle ) LIBRARY "KERNEL32.dll"



  1. Helpful 2
There are no comments made yet.
  • Page :
  • 1


There are no replies made for this question yet.
However, you are not allowed to reply to this question.