UtilFileTypeGetFileTypeMatches(String, FileType) Method
Tries to detect the file type of the specified file by analyzing a collection of file type signatures
on the file header, then returns a ListT that contains
the success percentage (0%...100%) of each file type found (if any).
Namespace: DevCase.Core.IO.FileSystemAssembly: DevCase.net48 (in DevCase.net48.dll) Version: 6.0.0.0 (6.0)
XMLNS for XAML: Not mapped to an xmlns.
Public Shared Function GetFileTypeMatches (
filepath As String,
filetypes As FileType()
) As List(Of FileTypeMatch)
Dim filepath As String
Dim filetypes As FileType()
Dim returnValue As List(Of FileTypeMatch)
returnValue = UtilFileType.GetFileTypeMatches(filepath,
filetypes)
No code example is currently available or this language may not be supported.
- filepath String
-
The source file.
- filetypes FileType
-
A set of file types to match in the file header.
ListFileTypeMatch
A
ListT which contains
the match results of the file types that were found (if any) in the file header.
This is a code example.
No code example is currently available or this language may not be supported.
Dim filetypes As FileType() = FileTypeUtil.FiletypesDict("reg")
Dim matches As List(Of FileTypeMatch) = GetFileTypeMatches(New FileInfo("C:\Registry File.reg"), filetypes)
If (filetypeMatches.Count <> 0) Then
For Each match As FileTypeMatch In matches
Console.WriteLine("
File Type Name.......: {0}
File Extension.......: {1}
Percent Match........: {2}%
Signature Count......: {3}
Signature Match Count: {4}",
match.FileType.Name, match.FileType.Extension, match.PercentMatch,
match.FileType.Signatures.Count, match.SignatureMatchCount)
Next match
Else
Console.WriteLine("Any file type match found.")
End If
No code example is currently available or this language may not be supported.
No code example is currently available or this language may not be supported.
No code example is currently available or this language may not be supported.
No code example is currently available or this language may not be supported.