Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7048959
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T02:57:16+00:00 2026-05-28T02:57:16+00:00

My program sets its display based on if the program is running for the

  • 0

My program sets its display based on if the program is running for the first time or not. In order to determine if the program is running for the first time I am currently using a

//this boolean exists within my programs settings
Setting boolean FirstRun = True;

When the program runs it calls a method that checks the state of that bool value and acts accordingly:

if(Properties.Settings.FirstRun == true)
{ lblGreetings.Text = "Welcome New User";
  //Change the value since the program has run once now
  Properties.Settings.FirstRun = false;
  Properties.Settings.Save(); }
else
{ lblGreetings.Text = "Welcome Back User"; }

It seems to work pretty effectively, however if the .exe file is moved and launched from a new location it considers it a first run, and I’m concerned that I’m doing this in a messy fashion and perhaps there exists a more efficient manner to test for the programs first run. Is there a better way to do this?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-28T02:57:17+00:00Added an answer on May 28, 2026 at 2:57 am

    Seems that your problem is actually that if you move executable to another location/folder on the same pc, it loses somehow the information about the fact that it was already run at least once.

    Using UserSettings, on Properties.Settings.Default.FirstRun should resolve your problem.

    Something like this, a pseudocode:

    if(Properties.Settings.Default.FirstRun == true)
    { lblGreetings.Text = "Welcome New User";
      //Change the value since the program has run once now
      Properties.Settings.Default.FirstRun = false;
      Properties.Settings.Default.Save(); }
    else
    { lblGreetings.Text = "Welcome Back User"; }
    

    Look on this sample how to achieve that in more detailed way.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am running a java program that sets up a database connection to an
I'm currently working on a C++ program in Windows XP that processes large sets
Last week, we created a program that manages sets of strings, using classes and
Right what im trying to accomplish is a program that basically sets the active
Is there any way to launch a program with a shortcut, that sets the
My Program overrides public void paint(Graphics g, int x, int y); in order to
For my first Silverlight app, I've written a program that sends user-supplied search strings
I am running a little program in python that launches a small window that
I'm trying to create a program with two (or more) discrete sets of settings,
I have a program that sets the network interface to promiscuous mode, creates a

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.