I m selecting the folder & playing all the files in the media player, of that folder. As u know folder contains all types of files including text,zip,image & so on.
So I want that when URL that is assigned to Media Player is .txt,then i assign any default image from resources.
I do not want to check extensions-
Currently I m checking the extension of each file before paying but i dont want dat.
Public Class Form1
Public Ext_bmp As String = ".bmp"
Public Ext_jpg As String = ".jpg"
Public Ext_jpeg As String = ".jpeg"
Public Ext_gif As String = ".gif"
Public Ext_wma As String = ".wma"
Public sExe_asx As String = ".asx"
Public sExe_wax As String = ".wax"
Public sExe_m3u As String = ".m3u"
Public sExe_wpl As String = ".wpl"
Public sExe_wvx As String = ".wvx"
Public sExe_wmx As String = ".wmx"
Public sExe_searchms As String = ".search-ms"
Public sExe_dvrms As String = ".dvr-ms"
Public sExe_mid As String = ".mid"
Public sExe_rmi As String = ".rmi"
Public sExe_midi As String = ".midi"
Public sExe_mpeg As String = ".mpeg"
Public sExe_mpg As String = ".mpg"
Public sExe_m1v As String = ".m1v"
Public sExe_m2v As String = ".m2v"
Public sExe_mod As String = ".mod"
Public sExe_mp2 As String = ".mp2"
Public sExe_mpa As String = ".mpa"
Public sExe_mpe As String = ".mpe"
Public sExe_ifo As String = ".ifo"
Public sExe_vob As String = ".vob"
Public sExe_wav As String = ".wav"
Public sExe_snd As String = ".snd"
Public sExe_au As String = ".au"
Public sExe_aif As String = ".aif"
Public sExe_aifc As String = ".aifc"
Public sExe_aiff As String = ".aiff"
Public sExe_wmv As String = ".wmv"
Public sExe_wmd As String = ".wmd"
Public sExe_avi As String = ".avi"
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Try
Dim sExtension As String
sExtension = IO.Path.GetExtension("sFileName")
If Trim(sExtension) = Trim(Ext_bmp) Or _
Trim(sExtension) = Trim(Ext_gif) Or _
Trim(sExtension) = Trim(Ext_jpeg) Or _
Trim(sExtension) = Trim(Ext_jpg) Or _
Trim(sExtension) = Trim(Ext_wma) Or _
Trim(sExtension) = Trim(sExe_asx) Or _
Trim(sExtension) = Trim(sExe_wax) Or _
Trim(sExtension) = Trim(sExe_m3u) Or _
Trim(sExtension) = Trim(sExe_wpl) Or _
Trim(sExtension) = Trim(sExe_wvx) Or _
Trim(sExtension) = Trim(sExe_wmx) Or _
Trim(sExtension) = Trim(sExe_searchms) Or _
Trim(sExtension) = Trim(sExe_dvrms) Or _
Trim(sExtension) = Trim(sExe_mid) Or _
Trim(sExtension) = Trim(sExe_rmi) Or _
Trim(sExtension) = Trim(sExe_midi) Or _
Trim(sExtension) = Trim(sExe_mpeg) Or _
Trim(sExtension) = Trim(sExe_mpg) Or _
Trim(sExtension) = Trim(sExe_m1v) Or _
Trim(sExtension) = Trim(sExe_m2v) Or _
Trim(sExtension) = Trim(sExe_mod) Or _
Trim(sExtension) = Trim(sExe_mp2) Or _
Trim(sExtension) = Trim(sExe_mpa) Or _
Trim(sExtension) = Trim(sExe_mpe) Or _
Trim(sExtension) = Trim(sExe_ifo) Or _
Trim(sExtension) = Trim(sExe_vob) Or _
Trim(sExtension) = Trim(sExe_wav) Or _
Trim(sExtension) = Trim(sExe_snd) Or _
Trim(sExtension) = Trim(sExe_au) Or _
Trim(sExtension) = Trim(sExe_aif) Or _
Trim(sExtension) = Trim(sExe_aifc) Or _
Trim(sExtension) = Trim(sExe_aiff) Or _
Trim(sExtension) = Trim(sExe_wmv) Or _
Trim(sExtension) = Trim(sExe_wmd) Or _
Trim(sExtension) = Trim(sExe_avi) Then
WindowsMediaPlayer.URL = sFileName
Else
WindowsMediaPlayer.URL = My.Resources.PlayListImage
End If
Catch ex As Exception
MsgBox(ex.Message)
End Try
End Sub
End Class