在Visual Basic 6.0中使用D-LINK dwm-156 gsm调制解调器发送短信

时间:2018-05-08 14:23:42

标签: vb6

美好的一天女士/先生

我正在使用gsm调制解调器D-LINK DWM - 156在vb 6.0中发送短信但它无法正常工作。请帮我。这是我的代码

Private Sub cmdSend_Click()
On Error Resume Next
    With objcom
        .CommPort = txtPort.Text
        .Settings = "9600,N,8,1"
        .RTSEnable = False
        .DTREnable = False
        .RThreshold = 1
        .SThreshold = 0
        .PortOpen = True
        .Output = "AT" & vbCrLf
        .Output = "AT+CMGF=1" & vbCrLf
        .Output = "AT+CMGS=" & Chr(34) & Trim(txtNumber) & Chr(34) & vbCrLf
        .Output = Trim(txtMsg) & Chr(26)
        Sleep 5000
        .PortOpen = True
    End With
MsgBox ("Message Sent!")
End Sub
提前谢谢。

0 个答案:

没有答案