Protéger votre ordinateur avec un carte a puce

Description

protection d'un microordinateur avec un carte a puce et l'utelesation le compsantt mscomm de visual basic6

Source / Exemple :


Private Sub Command1_Click()
Dim a(64)  'tabl de 64 donne
i = 0       'initial i=0
Text1.Text = ""   ' efface tout les zone textbox
Text2.Text = ""
Text3.Text = ""
Text4.Text = ""
Text5.Text = ""
Text6.Text = ""
Text7.Text = ""
Text8.Text = ""
MSComm1.PortOpen = True 'ouvrir la port com1
'//rest de la carte --------_____-----
For y = 0 To 300
MSComm1.RTSEnable = True
Next
MSComm1.RTSEnable = False
'//fin de rest
MSComm1.InputLen = 1 'donne qui recoi dan le tampon
Do
If MSComm1.InBufferCount Then GoTo 10 ' attend le donne carte --------> micro
20:
l = l + 1
If l = 10000 Then GoTo fin
Loop
10:
donne = MSComm1.Input ' donne
'a(i) = Hex(Asc(b)) ' if la donne affiche en hexadicimal
a(i) = donne
i = i + 1
l = 0
ProgressBar1.Value = i
If i < 64 Then GoTo 20 ' 64 donne envoi
For i = 0 To 7     ' affichage les donne don la de text
Text1.Text = Text1.Text & a(i)
Next
For i = 8 To 15
Text2.Text = Text2.Text & a(i)
Next
For i = 16 To 23
Text3.Text = Text3.Text & a(i)
Next
For i = 24 To 31
Text4.Text = Text4.Text & a(i)
Next
For i = 32 To 39
Text5.Text = Text5.Text & a(i)
Next
For i = 40 To 47
Text6.Text = Text6.Text & a(i)
Next
For i = 48 To 55
Text7.Text = Text7.Text & a(i)
Next
For i = 56 To 63
Text8.Text = Text8.Text & a(i)
Next
Command2.Enabled = True
fin:
MSComm1.PortOpen = False
ProgressBar1.Value = 0
End Sub

Private Sub Command2_Click()
Unload Me
End Sub

Private Sub Form_Load()
Dim lngRetVal As Long
Dim blnPrevValue As Boolean
lngRetVal = SystemParametersInfo(SPI_SCREENSAVERRUNNING, True, _
blnPrevValue, 0&)
Command2.Enabled = False
End Sub

Private Sub Option1_Click()
MSComm1.CommPort = 1 ' choit com1
End Sub

Private Sub Option2_Click()
MSComm1.CommPort = 2  'choit com2
End Sub

Codes Sources

A voir également

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.