Results 1 to 2 of 2

Thread: [RESOLVED] [2008] determine if the program is running for the1st time

  1. #1

    Thread Starter
    Fanatic Member
    Join Date
    Oct 2008
    Location
    Dominican Republic
    Posts
    733

    Resolved [RESOLVED] [2008] determine if the program is running for the1st time

    Hi, i wanted to know if there is a way for the program to determine if its being run for the first time in a computer or in a different user.

  2. #2
    Super Moderator jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    111,222

    Re: [2008] determine if the program is running for the1st time

    Add a Boolean value to your Settings, name it FirstRun and set its value to True. Then in code you can do this:
    vb.net Code:
    1. If My.Settings.FirstRun Then
    2.     'This is the first time the app has been run by this Windows user.
    3.  
    4.     My.Settings.FirstRun = False
    5. End If
    Just note that if the user ever deletes their config file then the app will think the next run is their first. That's not something that should be happening without a good reason though.
    Why is my data not saved to my database? | MSDN Data Walkthroughs
    VBForums Database Development FAQ
    My CodeBank Submissions: VB | C#
    My Blog: Data Among Multiple Forms (3 parts)
    Beginner Tutorials: VB | C# | SQL

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width