0

I need to save the user's data for the first time he opens the app and never show it again.

Let's say I need the user to enter his first name and other data, and save it so the application can use it later. The user enters his first name, and the next time he opens the application, he doesn't get asked to enter his name again. The application just goes to the main screen.

How can I do this?

Ry-
  • 218,210
  • 55
  • 464
  • 476
Reality Returns
  • 180
  • 1
  • 1
  • 8

1 Answers1

1

You can use application settings. Open your project's properties (My Project in the Solution Explorer), go to the Settings tab, and make a setting. I'll assume you called it FirstName. Keep everything else as-is (User Setting, String) and save.

Now you can use this setting just like any other property, except it'll persist between runs. You can find the property in the My.Settings class. To set it the first time:

My.Settings.FirstName = userFirstName

And to use it later, it's just My.Settings.FirstName.

Ry-
  • 218,210
  • 55
  • 464
  • 476