From your screenshot, it looks like you haven’t set your application’s Settings.
Project Settings can be set by navigating to Project Properties > Settings:
When this has been done, they can be referenced and modified by using My.Settings.[setting]
, and saving them with My.Settings.Save()
, as per se:
My.Settings.Username = "Foo"
My.Settings.Password = "Bar"
My.Settings.Save()
You can add any My.Settings
property you want, but however you must ensure you choose the correct Type for your data.
Another question I answered may aid you in this respect, to quote:
A
User
setting creates new settings for each user account the
application is run under, theApplication
setting makes it so that the
settings are global and affects everyone regardless of what privileges
they hold in the system.There are also differences to how the settings are saved:
Application: Saves in the
[project name].config
fileUser: Saves in
<c:\Documents>\<username>\[LocalSettings\]ApplicationData\<companyname>\<appdomainname>_<eid>_<hash>\<version>
You can see more here on where the settings are saved.
3
solved Visual Basic username password error [closed]