| title | How to: Read Application Settings in Visual Basic | |||
|---|---|---|---|---|
| ms.custom | ||||
| ms.date | 07/20/2015 | |||
| ms.prod | .net | |||
| ms.reviewer | ||||
| ms.suite | ||||
| ms.technology |
|
|||
| ms.topic | article | |||
| helpviewer_keywords |
|
|||
| ms.assetid | eb3428ef-115e-49a8-a878-e0613183fee0 | |||
| caps.latest.revision | 12 | |||
| author | dotnet-bot | |||
| ms.author | dotnetcontent |
You can read a user setting by accessing the setting's property on the My.Settings object.
The My.Settings object exposes each setting as a property. The property name is the same as the setting name, and the property type is the same as the setting type. The setting's Scope indicates if the property is read-only; the property for an Application scope setting is read-only, while the property for a User scope setting is read-write. For more information, see My.Settings Object.
This example displays the value of the Nickname setting.
[!code-vbVbVbalrMyResources#14]
For this example to work, your application must have a Nickname setting, of type String. For more information, see Managing Application Settings (.NET).
My.Settings Object
How to: Change User Settings in Visual Basic
How to: Persist User Settings in Visual Basic
How to: Create Property Grids for User Settings in Visual Basic
Managing Application Settings (.NET)