Imports System.IO Imports System.Text.Encoding Imports System.Xml.Serialization Public Sub SettingFile() Try Dim contentsList As Question Dim serializer As New System.Xml.Serialization.XmlSerializer(GetType(Question)) Using sr As New StreamReader(_filepath, GetEncoding("shift-jis")) contentsList = serializer.Deserialize(sr) End Using For Each contents As Contents In contentsList Me.TextBox1.AppendText(contents.No & Environment.NewLine) Me.TextBox1.AppendText(contents.Q & Environment.NewLine) Me.TextBox1.AppendText(contents.Anser & Environment.NewLine) Me.TextBox1.AppendText(Environment.NewLine) Next Catch ex As Exception MessageBox.Show(ex.Message.ToString()) End Try End Sub <XmlType("question")> _ Public Class Question Inherits List(Of Contents) End Class <XmlType("contents")> _ Public Class Contents Dim no_ As Integer <XmlAttribute("no")> _ Public Property No() As Integer Get Return Me.no_ End Get Set(ByVal value As Integer) Me.no_ = value End Set End Property Dim q_ As String <XmlElement("q")> _ Public Property Q() As String Get Return Me.q_ End Get Set(ByVal value As String) Me.q_ = value End Set End Property Dim anser_ As String <XmlElement("anser")> _ Public Property Anser() As String Get Return Me.anser_ End Get Set(ByVal value As String) Me.anser_ = value End Set End Property End Class