Advertisement
NAK

File List&Load (VB.NET)

NAK
Jul 8th, 2013
91
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
VB.NET 0.61 KB | None | 0 0
  1. Public Class Form1
  2.  
  3.     Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
  4.         ' make a reference to a directory
  5.         Dim di As New IO.DirectoryInfo("c:\Anime\")
  6.         Dim diar1 As IO.FileInfo() = di.GetFiles()
  7.         Dim dra As IO.FileInfo
  8.  
  9.         ' you can do this instead of a for loop
  10.         ListBox1.DataSource = diar1
  11.  
  12.     End Sub
  13.  
  14.     Private Sub Button3_Click(sender As Object, e As EventArgs) Handles Button3.Click
  15.         Dim tdra As IO.FileInfo = ListBox1.SelectedItem
  16.         Process.Start(tdra.FullName)
  17.     End Sub
  18.  
  19. End Class
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement