Imports System.Xml

Imports System.IO

 

Public Class Form1

 

    Dim strXMLFilename As String = "C:\xml L11 Finished\quiz\quiz.xml"

    Dim doc As XmlDocument

 

 

    Private Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load

 

        If Not My.Computer.FileSystem.FileExists(strXMLFilename) Then

 

            Dim sw As StreamWriter

            sw = New StreamWriter(strXMLFilename)

 

            sw.WriteLine("<?xml version=""1.0"" encoding=""ISO-8859-1""?>")

            sw.WriteLine("<quiz></quiz>")

            sw.Close()

 

        End If

 

        doc = New XmlDocument()

        doc.Load(strXMLFilename)

 

        txtQuestion.Select()

 

        Me.KeyPreview = True

 

    End Sub