|
Public Class Form1
Dim MyAppSettings As New MyAppSettings
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
LoadSettings()
End Sub
Sub LoadSettings()
Dim UserName As String = MyAppSettings.UserName
If UserName.Trim.Equals("") Then UserName = "Please type your Name"
txtUserName.Text = UserName
lblLoginCount.Text = MyAppSettings.LoginCount + 1
lblFileCreated.Text = CType(MyAppSettings.ListItems("FileCreated"), Date).ToShortDateString
If Not IsNothing(MyAppSettings.ListItems("FileModified")) AndAlso Not MyAppSettings.ListItems("FileModified").Equals("") Then _
lblFileModified.Text = CType(MyAppSettings.ListItems("FileModified"), Date).ToShortDateString
End Sub
Sub SaveSettings()
MyAppSettings.UserName = txtUserName.Text
MyAppSettings.LoginCount += 1
MyAppSettings.ListItems("FileModified") = Now
MyAppSettings.SaveXmlCurrentConfiguration()
End Sub
Private Sub btnSave_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnSave.Click
SaveSettings()
LoadSettings()
End Sub
Private Sub btnLoad_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnLoad.Click
LoadSettings()
End Sub
End Class
|
By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.
If a file you wish to view isn't highlighted, and is a text file (not binary), please
let us know and we'll add colourisation support for it.
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.