Public Sub ListLoad() Dim files As String() = System.IO.Directory.GetFiles( _ Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments) & "\Bvets\Scenarios", "*.txt", System.IO.SearchOption.TopDirectoryOnly) Dim table As New DataTable 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 dataClumn5 As DataColumn = table.Columns.Add("ファイル名") For i = 0 To files.Length - 1 Dim sr As New System.IO.StreamReader(files(i), _ System.Text.Encoding.GetEncoding("shift_jis")) Dim r_image As String = "" Dim r_title As String = "" Dim r_author As String = "" Dim r_comment As String = "" '内容を一行ずつて読み込む 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 imgFl As String = (Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments) & "\Bvets\Scenarios\" & r_image) Dim a_image As Image If File.Exists(imgFl) Then a_image = New Bitmap(Image.FromFile(Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments) & "\Bvets\Scenarios\" & r_image), 120, 90) Else a_image = New Bitmap(My.Resources.noimage, 120, 90) End If table.Rows.Add(a_image, r_title, r_author, r_comment, files(i).ToString) Next i DataGridView1.DataSource = table End Sub