??不定的出现乱码问题
你加了CRC校验没有?

解决方案 »

  1.   

    汉字的收发必须用BINARY方式。下面的程序能实现汉字收发。 
    ////////////////////////////////////////////////////////////////////
    发:
    Dim ytemp() As Byte
    Dim stemp As String
    stemp = "你好!"
    ytemp = StrConv(stemp, vbFromUnicode)
    Debug.Print UBound(ytemp)
    MSComm1.Output = ytemp -------------------------------------------------------------------
    收:
    Private Sub mscTest_OnComm()
    '中文收发
    Dim yTemp() As Byte
    Dim stemp As String
    Dim i As Integer
    If mscTest.InBufferCount > 0 Then
    i = mscTest.InBufferCount
    yTemp = mscTest.Input
    stemp = StrConv(yTemp, vbUnicode)
    txtTest1.Text = stemp
    End If
    End Sub 
      

  2.   

    MSComm1.InputMode=comInputModeText 
    将输入模式设置成文本形式就可以了。