Dim fs As New FileStream(Filepath, IO.FileMode.Open, IO.FileAccess.ReadWrite, IO.FileShare.ReadWrite)
Dim reader As New BinaryReader(fs)
Dim pointeur As Integer = convert.toint32("85F4",16) ' départ position comptage
Dim compteur As Integer = 0
Dim chn As String
Do
reader.BaseStream.Position = pointeur
chn = BitConverter.ToString(reader.ReadBytes(4), 0, 4).Replace("-", "")
If chn = "3234372C" Then Exit Do
compteur = compteur + 1
pointeur = pointeur + 8
Loop
fs.Close()
reader.Close()
Vous n’avez pas trouvé la réponse que vous recherchez ?
Posez votre questionDim fs As New FileStream(FilePath, IO.FileMode.Open, IO.FileAccess.ReadWrite, IO.FileShare.ReadWrite) Dim reader As New BinaryReader(fs) reader.BaseStream.Position = &H95FC Dim compter As Integer = 0 Do hexnomber = BitConverter.ToString(reader.ReadBytes(4), 0, 4).Replace("-", "") If hexnomber = "7FFFFFFF" Then Exit Do reader.BaseStream.Position += 4 compter = compter + 1 Label2.Text = compter Loop fs.Close() reader.Close()