Quantcast
Channel: XML, System.Xml, MSXML and XmlLite forum
Viewing all articles
Browse latest Browse all 935

Editing XML File through VP App

$
0
0

So, I'm making an App for my software class, it's an ATM. It starts off with a form, where you enter the PIN into the textbox, and it checks against the XML file, and if it's correct, it lets you in.

Code:

Private Sub btnPINENTER_Click(sender As Object, e As EventArgs) Handles btnPINENTER.Click

    Dim AccountPIN As Integer

    Dim AccountName As String

    Dim InputPIN As Integer = Val(txtPIN.Text)

    Dim xelement As XElement = XElement.Load("Accounts.xml")
    Dim Records As IEnumerable(Of XElement) = xelement.Elements()

    For Each Account In Records
        AccountPIN = (Account.Element("PIN").Value)
        AccountName = (Account.Element("Name").Value)

        If InputPIN = AccountPIN Then

            MsgBox("Correct Password" & vbNewLine & "Welcome" & AccountName)
            Me.Hide()
            FrmATM.Show()
            txtPIN.Text = ""

        End If
    Next Account
End Sub

The next step is that the second form works like an ATM machine. So there are three buttons, Deposit, Withdraw and Account Balance. Now I need a way to be able to use the Deposit and WIthdraw buttons so that they can update the data in the XML File, but I'm clueless on how to do this. I'm a newbie as you can tell. Any help is greatly appreciated.


Viewing all articles
Browse latest Browse all 935

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>