Imports System
Imports System.IO
Public Class GifFile
Public Shared Sub Main()
Dim data As Byte() = New Byte(4) {}
Dim file As BinaryReader = New BinaryReader(File.Open("test.gif", FileMode.Open))
For i As Integer = 0 To 5 - 1
data(i) = file.ReadByte()
Next
file.Close()
If data(0) = Convert.ToByte("G"c) AndAlso data(1) = Convert.ToByte("I"c) AndAlso data(2) = Convert.ToByte("F"c) AndAlso data(3) = Convert.ToByte("8"c) Then
Console.WriteLine("Its a GIF8" & data(4))
Else
Console.WriteLine("It not gif file")
End If
End Sub
End Class