Click here to Skip to main content
15,885,782 members
Articles / Mobile Apps / Windows Mobile

Compact Framework Configuration XML File Read & Write like appSettings

Rate me:
Please Sign up or sign in to vote.
3.00/5 (1 vote)
13 Jan 2010CPOL2 min read 36.9K   922   20  
How to use an XML file to read and write aplication settings in a Window Mobile development
<Global.Microsoft.VisualBasic.CompilerServices.DesignerGenerated()> _
Partial Public Class Form1
    Inherits System.Windows.Forms.Form

    'Form overrides dispose to clean up the component list.
    <System.Diagnostics.DebuggerNonUserCode()> _
    Protected Overrides Sub Dispose(ByVal disposing As Boolean)
        If disposing AndAlso components IsNot Nothing Then
            components.Dispose()
        End If
        MyBase.Dispose(disposing)
    End Sub

    'Required by the Windows Form Designer
    Private components As System.ComponentModel.IContainer
    private mainMenu1 As System.Windows.Forms.MainMenu

    'NOTE: The following procedure is required by the Windows Form Designer
    'It can be modified using the Windows Form Designer.  
    'Do not modify it using the code editor.
    <System.Diagnostics.DebuggerStepThrough()> _
    Private Sub InitializeComponent()
        Me.mainMenu1 = New System.Windows.Forms.MainMenu
        Me.lblUserName = New System.Windows.Forms.Label
        Me.btnSave = New System.Windows.Forms.Button
        Me.btnLoad = New System.Windows.Forms.Button
        Me.txtUserName = New System.Windows.Forms.TextBox
        Me.Label1 = New System.Windows.Forms.Label
        Me.Label2 = New System.Windows.Forms.Label
        Me.lblLoginCount = New System.Windows.Forms.Label
        Me.Label4 = New System.Windows.Forms.Label
        Me.Label5 = New System.Windows.Forms.Label
        Me.Label6 = New System.Windows.Forms.Label
        Me.lblFileCreated = New System.Windows.Forms.Label
        Me.lblFileModified = New System.Windows.Forms.Label
        Me.SuspendLayout()
        '
        'lblUserName
        '
        Me.lblUserName.Location = New System.Drawing.Point(4, 43)
        Me.lblUserName.Name = "lblUserName"
        Me.lblUserName.Size = New System.Drawing.Size(85, 20)
        Me.lblUserName.Text = "Your Name"
        '
        'btnSave
        '
        Me.btnSave.Location = New System.Drawing.Point(14, 231)
        Me.btnSave.Name = "btnSave"
        Me.btnSave.Size = New System.Drawing.Size(103, 34)
        Me.btnSave.TabIndex = 1
        Me.btnSave.Text = "Save/Update"
        '
        'btnLoad
        '
        Me.btnLoad.Location = New System.Drawing.Point(123, 230)
        Me.btnLoad.Name = "btnLoad"
        Me.btnLoad.Size = New System.Drawing.Size(105, 35)
        Me.btnLoad.TabIndex = 2
        Me.btnLoad.Text = "Load/Show"
        '
        'txtUserName
        '
        Me.txtUserName.Location = New System.Drawing.Point(95, 41)
        Me.txtUserName.Name = "txtUserName"
        Me.txtUserName.Size = New System.Drawing.Size(133, 21)
        Me.txtUserName.TabIndex = 3
        '
        'Label1
        '
        Me.Label1.Location = New System.Drawing.Point(4, 78)
        Me.Label1.Name = "Label1"
        Me.Label1.Size = New System.Drawing.Size(159, 20)
        Me.Label1.Text = "You've Update this settings"
        '
        'Label2
        '
        Me.Label2.Location = New System.Drawing.Point(184, 78)
        Me.Label2.Name = "Label2"
        Me.Label2.Size = New System.Drawing.Size(53, 20)
        Me.Label2.Text = "time/s"
        '
        'lblLoginCount
        '
        Me.lblLoginCount.Font = New System.Drawing.Font("Tahoma", 9.0!, System.Drawing.FontStyle.Bold)
        Me.lblLoginCount.Location = New System.Drawing.Point(157, 78)
        Me.lblLoginCount.Name = "lblLoginCount"
        Me.lblLoginCount.Size = New System.Drawing.Size(27, 20)
        Me.lblLoginCount.Text = "1"
        Me.lblLoginCount.TextAlign = System.Drawing.ContentAlignment.TopRight
        '
        'Label4
        '
        Me.Label4.BackColor = System.Drawing.Color.Silver
        Me.Label4.Font = New System.Drawing.Font("Tahoma", 12.0!, System.Drawing.FontStyle.Bold)
        Me.Label4.Location = New System.Drawing.Point(4, 4)
        Me.Label4.Name = "Label4"
        Me.Label4.Size = New System.Drawing.Size(233, 20)
        Me.Label4.Text = "SETTINGS"
        Me.Label4.TextAlign = System.Drawing.ContentAlignment.TopCenter
        '
        'Label5
        '
        Me.Label5.BackColor = System.Drawing.Color.FromArgb(CType(CType(224, Byte), Integer), CType(CType(224, Byte), Integer), CType(CType(224, Byte), Integer))
        Me.Label5.Location = New System.Drawing.Point(4, 154)
        Me.Label5.Name = "Label5"
        Me.Label5.Size = New System.Drawing.Size(128, 20)
        Me.Label5.Text = "Settings file installed:"
        '
        'Label6
        '
        Me.Label6.BackColor = System.Drawing.Color.FromArgb(CType(CType(224, Byte), Integer), CType(CType(224, Byte), Integer), CType(CType(224, Byte), Integer))
        Me.Label6.Location = New System.Drawing.Point(4, 179)
        Me.Label6.Name = "Label6"
        Me.Label6.Size = New System.Drawing.Size(128, 20)
        Me.Label6.Text = "Last Update:"
        '
        'lblFileCreated
        '
        Me.lblFileCreated.Font = New System.Drawing.Font("Tahoma", 8.0!, System.Drawing.FontStyle.Regular)
        Me.lblFileCreated.Location = New System.Drawing.Point(139, 153)
        Me.lblFileCreated.Name = "lblFileCreated"
        Me.lblFileCreated.Size = New System.Drawing.Size(100, 20)
        Me.lblFileCreated.Text = "Label3"
        '
        'lblFileModified
        '
        Me.lblFileModified.Font = New System.Drawing.Font("Tahoma", 8.0!, System.Drawing.FontStyle.Regular)
        Me.lblFileModified.Location = New System.Drawing.Point(139, 179)
        Me.lblFileModified.Name = "lblFileModified"
        Me.lblFileModified.Size = New System.Drawing.Size(100, 20)
        '
        'Form1
        '
        Me.AutoScaleDimensions = New System.Drawing.SizeF(96.0!, 96.0!)
        Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Dpi
        Me.AutoScroll = True
        Me.ClientSize = New System.Drawing.Size(240, 268)
        Me.Controls.Add(Me.lblFileModified)
        Me.Controls.Add(Me.lblFileCreated)
        Me.Controls.Add(Me.Label6)
        Me.Controls.Add(Me.Label5)
        Me.Controls.Add(Me.Label4)
        Me.Controls.Add(Me.lblLoginCount)
        Me.Controls.Add(Me.Label2)
        Me.Controls.Add(Me.Label1)
        Me.Controls.Add(Me.txtUserName)
        Me.Controls.Add(Me.btnLoad)
        Me.Controls.Add(Me.btnSave)
        Me.Controls.Add(Me.lblUserName)
        Me.Menu = Me.mainMenu1
        Me.Name = "Form1"
        Me.Text = "Form1"
        Me.ResumeLayout(False)

    End Sub
    Friend WithEvents lblUserName As System.Windows.Forms.Label
    Friend WithEvents btnSave As System.Windows.Forms.Button
    Friend WithEvents btnLoad As System.Windows.Forms.Button
    Friend WithEvents txtUserName As System.Windows.Forms.TextBox
    Friend WithEvents Label1 As System.Windows.Forms.Label
    Friend WithEvents Label2 As System.Windows.Forms.Label
    Friend WithEvents lblLoginCount As System.Windows.Forms.Label
    Friend WithEvents Label4 As System.Windows.Forms.Label
    Friend WithEvents Label5 As System.Windows.Forms.Label
    Friend WithEvents Label6 As System.Windows.Forms.Label
    Friend WithEvents lblFileCreated As System.Windows.Forms.Label
    Friend WithEvents lblFileModified As System.Windows.Forms.Label

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.

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


Written By
Spain Spain
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.

Comments and Discussions