Option Explicit On
Option Strict On
Imports System.IO
Public Class frmTaffPresent
Private Sub frmTaffPresent_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
Try
Dim pathMedia As String = Application.StartupPath & "\mediaRes"
Dim di As New IO.DirectoryInfo(pathMedia)
Dim diar1 As IO.FileInfo() = di.GetFiles()
Dim dra As IO.FileInfo
'list the names of all files in the specified directory
For Each dra In diar1
lsbTaffWma.Items.Add(dra.Name)
Next
Catch ex As Exception
MsgBox(ex.Message)
End Try
End Sub
Private Sub lsbTaffWma_DoubleClick(ByVal sender As Object, ByVal e As System.EventArgs) Handles lsbTaffWma.DoubleClick
Try
Dim pathVdo As String = Application.StartupPath & "\mediaRes\" & lsbTaffWma.SelectedItem.ToString
AxWindowsMediaPlayer1.URL = pathVdo
Catch ex As Exception
MsgBox(ex.Message)
End Try
End Sub
End Class
Tag : .NET, Win (Windows App), VB.NET, VS 2010 (.NET 4.x)