Hey I'm making a new program so I won't be able to post my code here yet.
But I wanted to ask you fine folk how I can check if a program is running for the first time.
if it runs for the first time = true
pop up an inputbox and ask them to create a password so they can access the menubar and store that password in a database
if it's not the first time it runs
Just start the program normally and when they click the menubar ask for the password they set in the first time
sorry if it's a little iffy on my side but I just started this project and I've only made the GUI and I have no idea what so ever how to do this.
5 Replies - 2695 Views - Last Post: 17 November 2009 - 05:11 AM
#1
Checking if program is running for the first time
Posted 17 November 2009 - 02:55 AM
Replies To: Checking if program is running for the first time
#2
Re: Checking if program is running for the first time
Posted 17 November 2009 - 03:11 AM
Hi,
I think the correct approach will be if you check the database if an user exists already.
If not, Setup the user.....
I think the correct approach will be if you check the database if an user exists already.
If not, Setup the user.....
#3
Re: Checking if program is running for the first time
Posted 17 November 2009 - 03:38 AM
motcom, on 17 Nov, 2009 - 02:11 AM, said:
Hi,
I think the correct approach will be if you check the database if an user exists already.
If not, Setup the user.....
I think the correct approach will be if you check the database if an user exists already.
If not, Setup the user.....
there is no need to setup a user, just set a password so that the admin(s) can print the report at the end of the day and keeping out the people who don't need to access the program settings but do have to work with it.
in a older version of this program the password is set in the DB, but it doens't work anymore and I can't seem to fix it. So I'm re-writing the whole program
#4
Re: Checking if program is running for the first time
Posted 17 November 2009 - 03:55 AM
Hi,
Well....
If its not a user, it would be a Password...
So lets presume you have a Login Table, and a Password Column.
You would check if there is a row in the Login Table. If not you will insert a Password into the Login Table.
If yes, you will read the password from the Login Table and compare it to what the user has typed in....
Well....
If its not a user, it would be a Password...
So lets presume you have a Login Table, and a Password Column.
You would check if there is a row in the Login Table. If not you will insert a Password into the Login Table.
If yes, you will read the password from the Login Table and compare it to what the user has typed in....
#5
Re: Checking if program is running for the first time
Posted 17 November 2009 - 04:23 AM
check for something that should have been done on first run e.g a file created or something else
#6
Re: Checking if program is running for the first time
Posted 17 November 2009 - 05:11 AM
This is how I always do this; I make a new boolean setting (My.Settings), set it to false as the default, and then set it to true on the load event of the main form. That's how I know if the user is running my app for the first time.
Warning; if the user copies/pastes the program onto someone else's computer - it won't reset the value back to false. How ever, you could keep checking the computer name every startup too (and store it in a string setting), and if it's different than the previous setting, reset the boolean back to false .
Warning; if the user copies/pastes the program onto someone else's computer - it won't reset the value back to false. How ever, you could keep checking the computer name every startup too (and store it in a string setting), and if it's different than the previous setting, reset the boolean back to false .
This post has been edited by LeisureProgrammer: 17 November 2009 - 05:14 AM
Page 1 of 1
|
|

New Topic/Question
Reply




MultiQuote



|