jlmacdonald
Member
- Joined
- Apr 16, 2007
- Messages
- 7
- Programming Experience
- 1-3
Hello all,
I have an app that is currently functional released but our clients wish it to have some additional functionality implimented. Basically they want it to run on a couple of computers but only have one user use it at a time. (This app generates receipts numbers and so we only want want user at a time using it lest it give out incorrect receipt numbers.)
Currently I have some code implimented to check to see if the program is running but it will only look to see if it's running on that particular machine. This worked fine until we install it on other desktops.
In previous app I had a solution to this which seemed to work but I'm hoping that there is a more efficient way of doing this. Basically I had a SQL table that housed a GUID, username and timestamp. Upon startup the program would look in this table to see if there is a record present, if so it would generate a messagebox and then close. If there was no record then that would indicate that noone was using the program and would insert a record with the GUID, username and timestamp. Upon exiting the program, it would delete that record.
There was some arror trapping done just in case the program crashed so it wouldn't lock everyone out but I'm wondering if there's an easier way to do this? Can I make the program network aware to see if someone on the network is already running the app?
Like I said, the solution I came up with seemed to work but I was just wondering if there was a better, more efficient way of doing this.
Thanks for the help!
I have an app that is currently functional released but our clients wish it to have some additional functionality implimented. Basically they want it to run on a couple of computers but only have one user use it at a time. (This app generates receipts numbers and so we only want want user at a time using it lest it give out incorrect receipt numbers.)
Currently I have some code implimented to check to see if the program is running but it will only look to see if it's running on that particular machine. This worked fine until we install it on other desktops.
In previous app I had a solution to this which seemed to work but I'm hoping that there is a more efficient way of doing this. Basically I had a SQL table that housed a GUID, username and timestamp. Upon startup the program would look in this table to see if there is a record present, if so it would generate a messagebox and then close. If there was no record then that would indicate that noone was using the program and would insert a record with the GUID, username and timestamp. Upon exiting the program, it would delete that record.
There was some arror trapping done just in case the program crashed so it wouldn't lock everyone out but I'm wondering if there's an easier way to do this? Can I make the program network aware to see if someone on the network is already running the app?
Like I said, the solution I came up with seemed to work but I was just wondering if there was a better, more efficient way of doing this.
Thanks for the help!