Public Sub ListLoad() Dim files As String() = System.IO.Directory.GetFiles( _ Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments) & "\Bvets\Scenarios", "*.txt", System.IO.SearchOption.TopDirectoryOnly) Dim DataSet As New DataSet("Files") For i = 0 To files.Length - 1 Dim sr As New System.IO.StreamReader(files(i), _ System.Text.Encoding.GetEncoding("shift_jis")) Dim table As New DataTable Dim r_image As String = "" Dim r_title As String = "" Dim r_author As String = "" Dim r_comment As String = "" Dim dataClumn1 As DataColumn = table.Columns.Add("画像", GetType(Image)) Dim dataClumn2 As DataColumn = table.Columns.Add("路線名") Dim dataClumn3 As DataColumn = table.Columns.Add("製作") Dim dataClumn4 As DataColumn = table.Columns.Add("説明") Dim dgTable As DataGridTableStyle = New DataGridTableStyle Dim dgColumn1 As DataGridTextBoxColumn = New DataGridTextBoxColumn Dim dgColumn2 As DataGridTextBoxColumn = New DataGridTextBoxColumn Dim dgColumn3 As DataGridTextBoxColumn = New DataGridTextBoxColumn Dim dgColumn4 As DataGridTextBoxColumn = New DataGridTextBoxColumn dgTable.MappingName = table.TableName dgColumn1.MappingName = dataClumn1.ColumnName dgColumn2.MappingName = dataClumn2.ColumnName dgColumn3.MappingName = dataClumn3.ColumnName dgColumn4.MappingName = dataClumn4.ColumnName dgColumn1.Width = 100 dgColumn2.Width = 100 dgColumn3.Width = 100 dgColumn4.Width = 100 dgTable.GridColumnStyles.Add(dgColumn1) dgTable.GridColumnStyles.Add(dgColumn2) dgTable.GridColumnStyles.Add(dgColumn3) dgTable.GridColumnStyles.Add(dgColumn4) '内容を一行ずつて読み込む While sr.Peek() > -1 Dim rs As String = sr.ReadLine() If rs.Contains("Image = ") Then r_image = rs.Replace("Image = ", Nothing).ToString ElseIf rs.Contains("RouteTitle = ") Then r_title = rs.Replace("RouteTitle = ", Nothing).ToString ElseIf rs.Contains("Author = ") Then r_author = rs.Replace("Author = ", Nothing).ToString ElseIf rs.Contains("Comment = ") Then r_comment = rs.Replace("Comment = ", Nothing).ToString End If End While '閉じる sr.Close() Dim a_image As Image a_image = Image.FromFile(Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments) & "\Bvets\Scenarios\" & r_image) table.Rows.Add(a_image, r_title, r_author, r_comment) DataSet.Tables.Add(table) Next DataGridView1.DataSource = DataSet End Sub