(14/03/2018, 16:08)ates2014 yazdı: Sayın alpeki, mümkünse ikiside olsun.
Teşekkürler
Çözünürlük için MediaInfo'nun DLL dosyasını kullanmak lazım bunun dışında alabileceğiniz benim bildiğim bir yöntem yok. Dosya boyutunu öğrenmek için ise aşağıdaki fonksiyonu kullanabilirsiniz:
'---------------------------------------------------------------------------------------
' Procedure : GetFileInfo
' Author : Daniel Pineault, CARDA Consultants Inc.
' Website : http://www.cardaconsultants.com
' Purpose : Retrieve some basic file information
' Copyright : The following may be altered and reused as you wish so long as the
' copyright notice is left unchanged (including Author, Website and
' Copyright). It may not be sold/resold or reposted on other sites (links
' back to this site are allowed).
' Req'd Refs: Uses Late Binding, so none required
'
' Input Variables:
' ~~~~~~~~~~~~~~~~
' sFile : Fully qualified path & filename with extension of the file to report on
'
' Usage:
' ~~~~~~
' GetFileInfo "c:\Tests\myXLS.xls"
' GetFileInfo "c:\Tests\myMDB.mdb"
'
' Revision History:
' Rev Date(yyyy/mm/dd) Description
' **************************************************************************************
' 1 2017-09-01 Initial Release
'---------------------------------------------------------------------------------------
Public Function GetFileInfo(ByVal sFile As String)
On Error GoTo Error_Handler
Dim fso As Object
Dim f As Object
Set fso = CreateObject("Scripting.FileSystemObject")
Set f = fso.GetFile(sFile)
msgbox f.Name 'Could also use f.Name if we wanted to
msgbox "Size: " & f.Size 'We could just as easily use FileLen(sFile)
Error_Handler_Exit:
On Error Resume Next
Set f = Nothing
Set fso = Nothing
Exit Function
Error_Handler:
MsgBox "The following error has occured." & vbCrLf & vbCrLf & _
"Error Number: " & Err.Number & vbCrLf & _
"Error Source: GetFileInfo" & vbCrLf & _
"Error Description: " & Err.Description, _
vbCritical, "An Error has Occured!"
Resume Error_Handler_Exit
End Function
Kullanımı:
Kod:
GetFileInfo ("C:\Users\Quality\Desktop\7. Realm Veri Tabanı\1. Giriş.mp4")