Editeur hexadécimal : 256 octet??

gillesc - 18 févr. 2001 à 13:10
 int19h - 20 févr. 2001 à 12:44
Salut, je cherche un controle vb et son esplication qui me permette de faire une édition hexadécimal de 256 octet.
merci d'avance

3 réponses

tu veux lire 256 octets dans un fichier binaire? Bien c'est tout simple a faire :

open "Nom_Fichier" for binary as #1
z$=input$(256,#1)
close

t$ = "0123456789abcdef"

Text1 = ""
Text1.Font = "Courier new"

For a = 1 To Len(z$)
c = Asc(Mid$(z$, a, 1))
Text1 = Text1 + Mid$(t$, (c 16) + 1, 1) + Mid$(t$, (c And 15) + 1, 1) + " "If a 15 a / 15 Then Text1 Text1 + vbCrLf
Next

Note : Dans les proprietes de Texte1, mettre :
Multiline = True
ScrollBarre = 2 - vercical

a+
0
merci, mais en fait je veut afficher 256 octet en hexadecimal (FF pour 1 octet(256))
lisible facilement et surtout modifiable par l'utilisateur. en fait un genre d'éditeur hexadecimal.
(genre ultra edit en mode hexadecimal) mais limité à 256 octets.

merci quand même
0
Apres une p'tit nuit de repos, et des explications plus claire voila :

Private Sub Text1_KeyPress(KeyAscii As Integer)
If KeyAscii = 9 Then
Text1.SelStart = Text1.SelStart + 3
Text1.SelStart = (Text1.SelStart 3) * 3
End If
If (Text1.SelStart + 1) 3 (Text1.SelStart + 1) / 3 Then KeyAscii 0

If KeyAscii >= 48 And KeyAscii <= 57 Then
pos = Text1.SelStart
Text1 = Mid$(Text1, 1, Text1.SelStart) + Chr$(KeyAscii) + Mid$(Text1, Text1.SelStart + 2)
Text1.SelStart = pos + 1
End If

If KeyAscii >= Asc("a") And KeyAscii <= Asc("f") Then
pos = Text1.SelStart
Text1 = Mid$(Text1, 1, Text1.SelStart) + Chr$(KeyAscii) + Mid$(Text1, Text1.SelStart + 2)
Text1.SelStart = pos + 1
End If

If KeyAscii >= Asc("A") And KeyAscii <= Asc("F") Then
pos = Text1.SelStart
Text1 = Mid$(Text1, 1, Text1.SelStart) + Chr$(KeyAscii) + Mid$(Text1, Text1.SelStart + 2)
Text1.SelStart = pos + 1
End If

KeyAscii = 0

If (Text1.SelStart + 1) 3 = (Text1.SelStart + 1) / 3 Then Text1_KeyPress (9)

End Sub

Note : il faut mettre une TextBox de : 5055x3495 (soit : 337x223 pixel)
Puis :
Text1.Font = "Courier New"
Text1.FontSize = 8

a+

Int19h
0
Rejoignez-nous