Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>Have you thought about getting the framework to handle it instead?</p> <p>If you add an entry into the settings tab of the project properties with name acc, type string, scope user (or application, depending on requirements) and value pass, you can use the System.Configuration.ApplicationSettingsBase functionality to deal with it. </p> <pre><code> Private _settings As My.MySettings Private _acc as String Private _pass as String Public ReadOnly Property Settings() As System.Configuration.ApplicationSettingsBase Get If _settings Is Nothing Then _settings = New My.MySettings End If Return _settings End Get End Property Private Sub SetSettings() Settings.SettingsKey = Me.Name Dim theSettings As My.MySettings theSettings = DirectCast(Settings, My.MySettings) theSettings.acc=_acc theSettings.pass=_pass Settings.Save() End Sub Private Sub GetSettings() Settings.SettingsKey = Me.Name Dim theSettings As My.MySettings theSettings = DirectCast(Settings, My.MySettings) _acc=theSettings.acc _pass=theSettings.pass End Sub </code></pre> <p>Call GetSettings in whatever load event you need, and SetSettings in closing events</p> <p>This will create an entry in the application.exe.config file, either in your local settings \apps\2.0\etc etc directory, or your roaming one, or if it's a clickonce deployment, in the clickonce data directory. This will look like the following:-</p> <pre><code>&lt;userSettings&gt; &lt;MyTestApp.My.MySettings&gt; &lt;setting name="acc" serializeAs="String"&gt; &lt;value&gt;blah&lt;/value&gt; &lt;/setting&gt; &lt;setting name="pass" serializeAs="String"&gt; &lt;value&gt;hello&lt;/value&gt; &lt;/setting&gt; &lt;/MyTestApp.My.MySettings&gt; &lt;/userSettings&gt; </code></pre>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload