مرحباً أخواني الكرام،
لقد قمت بكتابة ( Code ) قصير يساعدكم باستخراج معلومات من الممكن أن تفيدكم في معالجة الأنواع التالي :
EXE = Executable Files
JPG, PNG, BMP, GIF, TIFF, EXIF, EMF, Etc.. = Image Files
MP3, WAV, WMA, Etc... = Audio Files
ليس هناك الكثير ليشرح لأن عمليات المعالجة تتم عبر الـ( Shell32 Library ) أي ليس هناك اي شيفرة أو خوارزمية ليتم شرحها .
Imports Shell32
[color= #000000; font-weight: bold;]Public [color= #000000; font-weight: bold;]Class Form1
[color= #666666; font-style: italic;]#Region "ExecutableFiles"
[color= #000000; font-weight: bold;]Private Structure ExecutableFileSummary
[color= #000000; font-weight: bold;]Public FilePath [color= #b1b100;]As String
[color= #000000; font-weight: bold;]Public FileName [color= #b1b100;]As String
[color= #000000; font-weight: bold;]Public Directory [color= #b1b100;]As String
[color= #000000; font-weight: bold;]Public Format [color= #b1b100;]As String
[color= #000000; font-weight: bold;]Public CompanyName [color= #b1b100;]As String
[color= #000000; font-weight: bold;]Public Description [color= #b1b100;]As String
[color= #000000; font-weight: bold;]Public Version [color= #b1b100;]As String
[color= #000000; font-weight: bold;]Public ProductName [color= #b1b100;]As String
[color= #990000;]End Structure
[color= #000000; font-weight: bold;]Private [color= #000000; font-weight: bold;]Function GetExecutableFileSummary[color= #009900;](ByVal FilePath [color= #b1b100;]As String[color= #009900;]) [color= #b1b100;]As ExecutableFileSummar
y
Dim NEFSummary [color= #b1b100;]As [color= #000000; font-weight: bold;]New ExecutableFileSummary
With NEFSummary
[color= #339933;].FilePath [color= #339933;]= FilePath
[color= #339933;].FileName [color= #339933;]= IO[color= #339933;].Path[color= #339933;].GetFileName[color= #009900;](FilePath[color= #009900;])
[color= #339933;].Directory [color= #339933;]= FilePath[color= #339933;].Substring[color= #009900;]([color= #cc66cc;]0[color= #339933;], FilePath[color= #339933;].LastIndexOf[color= #009900;]([color= #0000ff;]"[color= #000099; font-weight: bold;]"))
[color= #0000ff;] Dim ShellClass As New Shell
[color= #0000ff;] Dim ShellF As Folder = ShellClass.NameSpace(.Directory)
[color= #0000ff;] Dim FItem As FolderItem = ShellF.ParseName(.FileName)
[color= #0000ff;] .Format = ShellF.GetDetailsOf(FItem, 2)
[color= #0000ff;] .CompanyName = ShellF.GetDetailsOf(FItem, 35)
[color= #0000ff;] .Description = ShellF.GetDetailsOf(FItem, 36)
[color= #0000ff;] .Version = ShellF.GetDetailsOf(FItem, 37)
[color= #0000ff;] .ProductName = ShellF.GetDetailsOf(FItem, 38)
[color= #0000ff;] End With
[color= #0000ff;] Return NEFSummary
[color= #0000ff;] End Function
[color= #0000ff;]#End Region
[color= #0000ff;]#Region "ImageFiles[color= #0000ff;]"
[color= #0000ff;] Private Structure ImageFileSummary
[color= #0000ff;] Public FilePath As String
[color= #0000ff;] Public FileName As String
[color= #0000ff;] Public Directory As String
[color= #0000ff;] Public Format As String
[color= #0000ff;] Public ImageDimensions As String
[color= #0000ff;] Public ImageWidthInPixel As String
[color= #0000ff;] Public ImageHeightInPixel As String
[color= #0000ff;] End Structure
[color= #0000ff;] Private Function GetImageFileSummary(ByVal FilePath As String) As ImageFileSummary
[color= #0000ff;] Dim NIFSummary As New ImageFileSummary
[color= #0000ff;] With NIFSummary
[color= #0000ff;] .FilePath = FilePath
[color= #0000ff;] .FileName = IO.Path.GetFileName(FilePath)
[color= #0000ff;] .Directory = FilePath.Substring(0, FilePath.LastIndexOf("[color= #0000ff;]"))
[color= #0000ff;] Dim ShellClass As New Shell
[color= #0000ff;] Dim ShellF As Folder = ShellClass.NameSpace(.Directory)
[color= #0000ff;] Dim FItem As FolderItem = ShellF.ParseName(.FileName)
[color= #0000ff;] .Format = ShellF.GetDetailsOf(FItem, 2)
[color= #0000ff;] .ImageDimensions = ShellF.GetDetailsOf(FItem, 26)
[color= #0000ff;] .ImageWidthInPixel = ShellF.GetDetailsOf(FItem, 27)
[color= #0000ff;] .ImageHeightInPixel = ShellF.GetDetailsOf(FItem, 28)
[color= #0000ff;] End With
[color= #0000ff;] Return NIFSummary
[color= #0000ff;] End Function
[color= #0000ff;]#End Region
[color= #0000ff;]#Region "AudioFiles[color= #0000ff;]"
[color= #0000ff;] Private Structure AudioFileSummary
[color= #0000ff;] Public FilePath As String
[color= #0000ff;] Public FileName As String
[color= #0000ff;] Public Directory As String
[color= #0000ff;] Public Format As String
[color= #0000ff;] Public ArtistName As String
[color= #0000ff;] Public TrackTitle As String
[color= #0000ff;] Public FramesCount As Int32
[color= #0000ff;] Public Comments As String
[color= #0000ff;] Public AlbumTitle As String
[color= #0000ff;] Public AlbumCreationDate As String
[color= #0000ff;] Public TrackNumber As Int32
[color= #0000ff;] Public Genre As String
[color= #0000ff;] Public Duration As String
[color= #0000ff;] Public BitRate As String
[color= #0000ff;] Public [Protected] As String
[color= #0000ff;] Public Quality As String
[color= #0000ff;] Public Channel As String
[color= #0000ff;] End Structure
[color= #0000ff;] Private Function GetAudioFileSummary(ByVal FilePath As String) As AudioFileSummary
[color= #0000ff;] Dim NAFSummary As New AudioFileSummary
[color= #0000ff;] With NAFSummary
[color= #0000ff;] .FilePath = FilePath
[color= #0000ff;] .FileName = IO.Path.GetFileName(FilePath)
[color= #0000ff;] .Directory = FilePath.Substring(0, FilePath.LastIndexOf("[color= #0000ff;]"))
[color= #0000ff;] Dim ShellClass As New Shell
[color= #0000ff;] Dim ShellF As Folder = ShellClass.NameSpace(.Directory)
[color= #0000ff;] Dim FItem As FolderItem = ShellF.ParseName(.FileName)
[color= #0000ff;] .Format = ShellF.GetDetailsOf(FItem, 2)
[color= #0000ff;] .ArtistName = ShellF.GetDetailsOf(FItem, 9)
[color= #0000ff;] .TrackTitle = ShellF.GetDetailsOf(FItem, 10)
[color= #0000ff;] .Genre = ShellF.GetDetailsOf(FItem, 12)
[color= #0000ff;] .FramesCount = ShellF.GetDetailsOf(FItem, 13)
[color= #0000ff;] .Comments = ShellF.GetDetailsOf(FItem, 14)
[color= #0000ff;] .AlbumTitle = ShellF.GetDetailsOf(FItem, 17)
[color= #0000ff;] .AlbumCreationDate = ShellF.GetDetailsOf(FItem, 18)
[color= #0000ff;] .TrackNumber = ShellF.GetDetailsOf(FItem, 19)
[color= #0000ff;] .Duration = ShellF.GetDetailsOf(FItem, 21)
[color= #0000ff;] .BitRate = ShellF.GetDetailsOf(FItem, 22)
[color= #0000ff;] .Protected = ShellF.GetDetailsOf(FItem, 23)
[color= #0000ff;] .Quality = ShellF.GetDetailsOf(FItem, 33)
[color= #0000ff;] .Channel = ShellF.GetDetailsOf(FItem, 34)
[color= #0000ff;] End With
[color= #0000ff;] Return NAFSummary
[color= #0000ff;] End Function
[color= #0000ff;]#End Region
[color= #0000ff;]End Classأسئلتكم مُرحب بها :)
بالتوفيق .
