VBcoders Browse New Submit Contact Sign In

No account? Register free

Forgot password?

Determine file format using file header, ignoring the extension

Detonate  (4 Submissions)   Files/File Controls/Input/Output   Visual Basic 3.0   Beginner   Wed 3rd February 2021

Determines the filetype (PE Executable, GIF Image, Word Document, etc) using the file header/contents, as opposed to using the file extension. Supported types: PE Executable, INI File, AVI Movie, WAV Audio, Word document, Access database, GIF Image, MP3 audio, BMP image, TIFF image, ZIP archive, ARJ archive, RAR archive, HTML/HTA docs, JPEG image, Visual Basic files. If it can't determine the filetype, itll try and determine if the file is text or binary.

Inputs
Public Function GetFileType(xFile As String) 'xFile is the full path:\filename of the file to test.

Returns
Returns a string indicating the filetype, or if the file is an unknown text or unknown binary file.

Rate Determine file format using file header, ignoring the extension (6(6 Vote))
Determine file format using file header, ignoring the extension.bas

Determine file format using file header, ignoring the extension Comments

No comments yet — be the first to post one!

Post a Comment

0/1000 characters