5 Replies - 3767 Views - Last Post: 17 November 2009 - 05:11 AM Rate Topic: -----

#1 briambo  Icon User is offline

  • D.I.C Head

Reputation: 0
  • View blog
  • Posts: 59
  • Joined: 09-November 09

Checking if program is running for the first time

Posted 17 November 2009 - 02:55 AM

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.

Is This A Good Question/Topic? 0
  • +

Replies To: Checking if program is running for the first time

#2 motcom  Icon User is offline

  • D.I.C Lover
  • member icon

Reputation: 290
  • View blog
  • Posts: 1,371
  • Joined: 16-June 08

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.....
Was This Post Helpful? 0
  • +
  • -

#3 briambo  Icon User is offline

  • D.I.C Head

Reputation: 0
  • View blog
  • Posts: 59
  • Joined: 09-November 09

Re: Checking if program is running for the first time

Posted 17 November 2009 - 03:38 AM

View Postmotcom, 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.....


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
Was This Post Helpful? 0
  • +
  • -

#4 motcom  Icon User is offline

  • D.I.C Lover
  • member icon

Reputation: 290
  • View blog
  • Posts: 1,371
  • Joined: 16-June 08

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....

;)
Was This Post Helpful? 0
  • +
  • -

#5 olibenu  Icon User is offline

  • D.I.C Addict
  • member icon

Reputation: 45
  • View blog
  • Posts: 537
  • Joined: 31-December 08

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
Was This Post Helpful? 0
  • +
  • -

#6 LeisureProgrammer  Icon User is offline

  • N00by VB.NET Developer
  • member icon

Reputation: 110
  • View blog
  • Posts: 588
  • Joined: 06-September 09

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 .

This post has been edited by LeisureProgrammer: 17 November 2009 - 05:14 AM

Was This Post Helpful? 1
  • +
  • -

Page 1 of 1