SALUT
Est ce qu'il y a quelqu’un qui peut m'aider à convertir ce code de VB6 en VB NET 2010, merci.
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
Private Sub Command1_Click()
   Text1.Text = ""
    strBuffer = ""
    If MSComm1.PortOpen = True Then MSComm1.PortOpen = False
    With MSComm1
        .CommPort = Combo1.Text
        .Settings = "115200,N,8,1"
        .Handshaking = comRTS
        .RTSEnable = True
        .DTREnable = True
        .RThreshold = 1
        .SThreshold = 1
        .InputMode = comInputModeText
        .InputLen = 0
        .PortOpen = True
        .Output = "AT+CUSD=1," & Chr(34) & "*710#" & Chr(34) & ",15" & vbCrLf
    End With
End Sub
Private Sub MSComm1_OnComm()
    strBuffer = strBuffer & MSComm1.Input
    Dim x As String
    If InStr(1, strBuffer, ",15") Then
        Dim s() As String
        s = Split(strBuffer, vbCrLf)
        Dim i As Integer
        For i = 0 To UBound(s)
            If InStr(1, s(i), "+CUSD") Then
                x = s(i)
            End If
        Next
    End If
    If x <> "" Then
       s = Split(x, ",")
       Text1.Text = Mid$(s(1), 2, Len(s(1)) - 2)
    End If
End Sub