»áÔ±£º ÃÜÂ룺 ¡¡Ãâ·Ñ×¢²á | Íü¼ÇÃÜÂë | »áÔ±µÇ¼ ÍøÒ³¹¦ÄÜ£º ¼ÓÈëÊÕ²Ø ÉèΪÊ×Ò³ ÍøÕ¾ËÑË÷  
 °²È«¼¼Êõ¼¼ÊõÎĵµ
  ¡¤ °²È«ÅäÖÆ
  ¡¤ ¹¤¾ß½éÉÜ
  ¡¤ ºÚ¿Í½Ìѧ
  ¡¤ ·À»ðǽ
  ¡¤ Â©¶´·ÖÎö
  ¡¤ ÆƽâרÌâ
  ¡¤ ºÚ¿Í±à³Ì
  ¡¤ ÈëÇÖ¼ì²â
 °²È«¼¼ÊõÂÛ̳
  ¡¤ °²È«ÅäÖÆ
  ¡¤ ¹¤¾ß½éÉÜ
  ¡¤ ·À»ðǽ
  ¡¤ ºÚ¿ÍÈëÇÖ
  ¡¤ Â©¶´¼ì²â
  ¡¤ Æƽⷽ·¨
  ¡¤ É±¶¾×¨Çø
 °²È«¼¼Êõ¹¤¾ßÏÂÔØ
  ¡¤ É¨Ã蹤¾ß
  ¡¤ ¹¥»÷³ÌÐò
  ¡¤ ºóÃÅľÂí
  ¡¤ ¾Ü¾ø·þÎñ
  ¡¤ ¿ÚÁîÆƽâ
  ¡¤ ´úÀí³ÌÐò
  ¡¤ ·À»ðǽ
  ¡¤ ¼ÓÃܽâÃÜ
  ¡¤ ÈëÇÖ¼ì²â
  ¡¤ ¹¥·ÀÑÝʾ
¼¼ÊõÎĵµ > VBÎĵµ > ÍøÂç±à³Ì
ÓÃMSComm¿Ø¼þʵÏÖÀ´µçÏÔʾ
·¢±íÈÕÆÚ£º2002-09-13 00:00:00×÷ÕߣºÀ ³ö´¦£º  

À´µçÏÔʾµÄʵÏÖ

MODEMµÄATÃüÁîCIDºÍVCIDÊÇÉèÖÃÊDz»ÊÇÀ´µçÏÔʾµÄ£¬Èç¹ûµçÐÅ¿ªÍ¨ÁËÀ´µçÏÔʾ¹¦ÄÜ

¾ÍÄÜͨ¹ýMODEMÀ´ÏÔʾ¶Ô·½µÄµç»°ºÅÂë¡£ÄÇôÊ×ÏÈÉèÖÃCID=1»òÊÇVCID=1

°ãÀ´ËµÀ´µçÏÔʾµÄÐÅϢΪ£º

DATE = MMDD "À´µçÈÕÆÚ MMDD

TIME = HHMM "À´µçʱ¼ä HHMM

NMBR = ######## "À´µçºÅÂë

³ÌÐòʵÏÖÈçÏÂ,ÉèÖÃMSComm1µÄÏà¹ØÉèÖ㬲¢½¨Á½¸öLabelΪLabel1ºÍLabel2

Function OpenCID(OpenCLose As Boolean) As Boolean

'´ò¿ª»òÊǹرÏÀ´µçÏÔʾ¹¦ÄÜ

  On Error Resume Next

  Dim ArrCID(1) As String

  ArrCID(0) = "at#cid=" & IIf(openclode, 1, 0)

  ArrCID(1) = "at#vcid=" & IIf(openclode, 1, 0)

  MSComm1.RThreshold = 0

  For i = 0 To 1

    MSComm1.Output = ArrCID(i) & vbCr

    EndTime = Timer + 0.5

    Do While bStop = False

      nTemp = nTemp + 1

      If MSComm1.InBufferCount >= 2 Then

        sTemp = MSComm1.Input

        If InStr(sTemp, "OK") = 0 Then

          bStop = True

          OpenCID = True

          Exit Function

        End If

      End If

      If Timer >= EndTime Or ErrorCode Then Exit Do

    Loop

  Next i

  OpenCID = False

  MSComm1.RThreshold = 1

End Function

ÏÂÃæµÄº¯ÊýÏÔʾÀ´µçºÅÂë²¢ÔÚ´°ÌåÉϵÄLabel1µÄLabel2ÉÏÏÔʾ³öÀ´

Private Sub MSComm1_OnComm()

  On Error Resume Next

  Static Buffer As String

   ' ÊÕµ½¶àÓÚ RThreshold ÊôÐÔÉèÖõÄ×Ö·ûÊý£¨RThreshold ÊôÐÔ±ØÐë´óÓÚ 0£©¡£

      'label1 = "ÊÕµ½" + Str(MSComm1.InBufferCount) + "¸ö×Ö·û"

      Buffer = Buffer + MSComm1.Input

      Buffer = UCase(Buffer)

     '  Exit Sub

      If InStr(1, Buffer, "RING", vbTextCompare) Then

      'ÊÕµ½ÕðÁå

        'Comm1.Output = "ATA" + Chr(13) 'ÃüÁî Modem Õª»úÏìÓ¦

        Buffer = "" 'Ç建³åÇø×Ö·û

        'mciExecute "sound " & SystemPath & "\ringin.wav"

        Label1 = "״̬£ºÊÕµ½ÕðÁå"

        Zhen = True

        frmCallID.Show

        frmCallID.ChangRing

       

        

      ElseIf InStr(1, Buffer, "CONNECT", vbTextCompare) Then

      '¶Ô·½Ó¦´ðºô½Ð

        Buffer = "" 'Ç建³åÇø×Ö·û

        Label1 = "״̬£ºÒѾ­½¨Á¢Á¬½Ó"

      ElseIf InStr(1, Buffer, "BUSY", vbTextCompare) Then

      '¶Ô·½Ïß·æ

        Buffer = "" 'Ç建³åÇø×Ö·û

        Label1 = "״̬£º¶Ô·½Ïß·æ"

      ElseIf InStr(1, Buffer, "No DIA", vbTextCompare) Then

        Buffer = "" 'Ç建³åÇø×Ö·û

        Label1 = "״̬£º²¦³öºÅÂë´í,Çë¼ì²éµç»°Ïß"

        Command1_Click

      ElseIf InStr(1, Buffer, "No CARRIER", vbTextCompare) Then

      '¶Ô·½Î´Õª»ú»òδÏìÓ¦

        Buffer = "" 'Ç建³åÇø×Ö·û

        Label1 = "״̬£º¶Ô·½Î´Õª»ú"

     

      ElseIf InStr(1, Buffer, "NMBR =", vbTextCompare) Then

       tmpStr = InStr(1, Buffer, "NMBR", vbTextCompare)

       CallNum = Right(Buffer, Len(Buffer) - lll - 6)

       Label2.Caption = "¶Ô·½µç»°£º" + CallNum

        'Buffer = "" 'Ç建³åÇø×Ö·û

      ElseIf InStr(1, Buffer, "OK", vbTextCompare) And Asc(Right(Buffer, 1)) = 10 Then

       If Zhen = False Then Buffer = "" 'Ç建³åÇø×Ö·û

       If Command1.Caption = "¹Ò¶Ï" Then

       Label2.Caption = "״̬£ºÒѾ­²¥Í¨µç»°£º" + txtCallNum

      End If

      End If

End Sub

¡¾·µ»Ø¶¥²¿¡¿ ¡¾´òÓ¡±¾Ò³¡¿ ¡¾¹Ø±Õ´°¿Ú¡¿

¹ØÓÚÎÒÃÇ / ¸øÎÒÁôÑÔ / °æȨ¾Ù±¨ / Òâ¼û½¨Òé / ÍøÕ¾±à³ÌQQȺ   
Copyright ©2003- 2024 Lihuasoft.net webmaster(at)lihuasoft.net ¼ÓÔØʱ¼ä 0.0014