Voila je sais pas si cette source est deja sur le site, surement que oui, dans se cas désoler car il ne me semble pas l'avoir vu ! (Jai cherché...)
Je met cette source pour tt le monde bien sur mais en particulier pour ceux qui s'embetait a faire une liste entiere vraiment tres longue des corespondence entre Texte et ASCII...
Mais c'est nullement necessaire car VB nous donne une fonction deaj toute prête qui converti un caractère en son code ASCII, alors pourquoi s'emerder ????
Voila c'est tres simple, trés court mais je l'espert trés utile.
PS: METEZ CE CODE DIRECTEMENT DANS UN FICHIER TEXTE QUE VOUS ENREGISTREREZ AVEC l'EXTENSION ".frm" (ceci vous evite de faire une interface, c'est pas pour 2 minutes mais bon.)
Source / Exemple :
VERSION 5.00
Begin VB.Form Form1
BorderStyle = 4 'Fixed ToolWindow
Caption = "TEXT TO ASCII (By OverDarck 2002)"
ClientHeight = 2655
ClientLeft = 45
ClientTop = 315
ClientWidth = 4635
LinkTopic = "Form1"
MaxButton = 0 'False
MinButton = 0 'False
ScaleHeight = 2655
ScaleWidth = 4635
StartUpPosition = 2 'CenterScreen
Begin VB.CheckBox Check1
Caption = "Mode VB"
Height = 255
Left = 120
TabIndex = 4
Top = 2220
Width = 1995
End
Begin VB.CommandButton Command2
Caption = "Quitter"
Height = 375
Left = 3480
TabIndex = 3
Top = 2160
Width = 1035
End
Begin VB.CommandButton Command1
Caption = "Go"
Height = 375
Left = 2400
TabIndex = 2
Top = 2160
Width = 1035
End
Begin VB.TextBox Text2
Height = 1515
Left = 120
MultiLine = -1 'True
ScrollBars = 2 'Vertical
TabIndex = 1
Top = 540
Width = 4395
End
Begin VB.TextBox Text1
Height = 315
Left = 120
TabIndex = 0
Top = 120
Width = 4395
End
End
Attribute VB_Name = "Form1"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Sub Command1_Click()
Dim I As Long
Text2.Text = vbNullString
If Check1.Value = 1 Then
For I = 0 To Len(Text1.Text) - 2
Text2.Text = Text2.Text & "Chr(" & Asc(Mid(Text1.Text, I + 1, 1)) & ") "
Next I
Text2.Text = Text2.Text & "Chr(" & Asc(Right(Text1.Text, 1)) & ")"
Else
For I = 0 To Len(Text1.Text) - 1
Text2.Text = Text2.Text & Asc(Mid(Text1.Text, I + 1, 1)) & " "
Next I
End If
End Sub
Private Sub Command2_Click()
End
End Sub
Private Sub Text1_KeyPress(KeyAscii As Integer)
If KeyAscii = vbKeyReturn Then Call Command1_Click
End Sub
Conclusion :
Voila, pour toute remarques critiques (a part sur mon aurtografe) n'hesitez surtout pas.
A bon entendeurs bonne prog a ts @++
Vous n'êtes pas encore membre ?
inscrivez-vous, c'est gratuit et ça prend moins d'une minute !
Les membres obtiennent plus de réponses que les utilisateurs anonymes.
Le fait d'être membre vous permet d'avoir un suivi détaillé de vos demandes et codes sources.
Le fait d'être membre vous permet d'avoir des options supplémentaires.