How To Get The Movie Duration Using VB.Net

Function GetMovieDuration(ByVal MovieFullPath As String) As String
     If File.Exists(MovieFullPath) Then
        Dim objShell As Object = CreateObject(“Shell.Application”)
        Dim objFolder As Object = _
           objShell.Namespace(Path.GetDirectoryName(MovieFullPath))
        For Each strFileName In objFolder.Items
            If strFileName.Name = Path.GetFileName(MovieFullPath) Then
                Return objFolder.GetDetailsOf(strFileName, 27).ToString
                Exit For
                Exit Function
            End If
        Next
        Return “0”
    Else
        Return “0”
    End If
End Function
‘———-
source: Link



Comments

Leave a Reply

XHTML: You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>