📄 frmdemo.frm
字号:
VERSION 5.00
Object = "{0D550370-2833-416C-BC3F-FB0CE4282E4E}#1.0#0"; "ArrowerSMS.ocx"
Begin VB.Form frmDemo
BorderStyle = 1 'Fixed Single
Caption = "安瑞尔短信控件使用示例(VB6.0版)-http://www.forwardsoft.net"
ClientHeight = 4890
ClientLeft = 45
ClientTop = 330
ClientWidth = 7425
BeginProperty Font
Name = "宋体"
Size = 9
Charset = 0
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
LinkTopic = "Form1"
MaxButton = 0 'False
MinButton = 0 'False
ScaleHeight = 4890
ScaleWidth = 7425
StartUpPosition = 2 '屏幕中心
Begin VB.CommandButton cmdExit
Caption = "退出(&E)"
Height = 345
Left = 6360
TabIndex = 26
Top = 4440
Width = 915
End
Begin VB.CommandButton cmdAbout
Caption = "关于(&A)"
Height = 345
Left = 5460
TabIndex = 27
Top = 4440
Width = 915
End
Begin VB.Frame Frame4
Caption = "读短信"
Height = 1400
Left = 3720
TabIndex = 14
Top = 120
Width = 3600
Begin VB.TextBox txtReadResult
Height = 660
Left = 120
TabIndex = 18
Top = 600
Width = 3345
End
Begin VB.CommandButton cmdRead
Caption = "读短信(&R)"
Enabled = 0 'False
Height = 345
Left = 2040
TabIndex = 17
Top = 180
Width = 1095
End
Begin VB.TextBox txtSMSNo
Height = 300
Left = 960
TabIndex = 16
Top = 210
Width = 795
End
Begin VB.Label Label7
Caption = "短信编号"
Height = 225
Left = 210
TabIndex = 15
Top = 270
Width = 735
End
End
Begin VB.Frame Frame3
Caption = "短信接收"
Height = 2775
Left = 3720
TabIndex = 7
Top = 1560
Width = 3615
Begin VB.TextBox txtRec
Height = 2355
Left = 50
MultiLine = -1 'True
TabIndex = 11
Top = 360
Width = 3495
End
End
Begin VB.Frame Frame2
Caption = "发短信"
Height = 3135
Left = 50
TabIndex = 6
Top = 1250
Width = 3600
Begin ArrowerSMSControl.ArrowerSMS ArrowerSMS1
Height = 600
Left = 240
TabIndex = 28
Top = 2280
Visible = 0 'False
Width = 600
_ExtentX = 1058
_ExtentY = 1058
End
Begin VB.CheckBox chkStatusReport
Caption = "要求状态报告"
Height = 255
Left = 840
TabIndex = 25
Top = 2700
Width = 1455
End
Begin VB.CheckBox ChkFlash
Caption = "发送闪信"
Height = 300
Left = 840
TabIndex = 23
Top = 2400
Width = 1455
End
Begin VB.CheckBox chkWap
Caption = "发送Wap Push"
Height = 255
Left = 840
TabIndex = 20
Top = 2160
Width = 1575
End
Begin VB.CommandButton cmdSend
Caption = "发送(&S)"
Enabled = 0 'False
Height = 345
Left = 2430
TabIndex = 13
Top = 2160
Width = 1035
End
Begin VB.TextBox txtMobileNo
Height = 270
Left = 870
TabIndex = 10
Text = "13910091873"
Top = 360
Width = 2625
End
Begin VB.TextBox txtmsg
Height = 1275
Left = 870
MultiLine = -1 'True
TabIndex = 8
Text = "frmDemo.frx":0000
Top = 810
Width = 2595
End
Begin VB.TextBox txtUrl
Height = 390
Left = 870
TabIndex = 21
Text = "http://wap.sina.com"
Top = 1680
Visible = 0 'False
Width = 2595
End
Begin VB.Label lblUrl
Caption = "URL:"
Height = 195
Left = 120
TabIndex = 22
Top = 1680
Visible = 0 'False
Width = 855
End
Begin VB.Label lblSub
Caption = "短信内容"
Height = 195
Left = 120
TabIndex = 12
Top = 840
Width = 855
End
Begin VB.Label Label1
AutoSize = -1 'True
Caption = "手机号码"
Height = 180
Left = 120
TabIndex = 9
Top = 360
Width = 720
End
End
Begin VB.Frame Frame1
Caption = "连接短信设备"
Height = 1080
Left = 30
TabIndex = 0
Top = 120
Width = 3645
Begin VB.TextBox TxtCom
Height = 300
Left = 960
TabIndex = 19
Text = "1"
Top = 600
Width = 735
End
Begin VB.CommandButton cmdDisConnect
Caption = "断开(&D)"
Enabled = 0 'False
Height = 320
Left = 2640
TabIndex = 5
Top = 600
Width = 855
End
Begin VB.CommandButton cmdConnect
Caption = "连接(&C)"
Height = 320
Left = 1800
TabIndex = 4
Top = 600
Width = 855
End
Begin VB.TextBox txtCenterNo
Alignment = 1 'Right Justify
Height = 270
Left = 1260
TabIndex = 1
Text = "+8613800100500"
Top = 240
Width = 2145
End
Begin VB.Label Label4
AutoSize = -1 'True
Caption = "短信中心号码:"
Height = 180
Left = 90
TabIndex = 3
Top = 240
Width = 1170
End
Begin VB.Label Label5
AutoSize = -1 'True
Caption = "串口选择:"
Height = 180
Left = 90
TabIndex = 2
Top = 630
Width = 810
End
End
Begin VB.Label Label2
Alignment = 2 'Center
Appearance = 0 'Flat
BackColor = &H00E0E0E0&
BackStyle = 0 'Transparent
Caption = " 安瑞尔科技(北京)有限公司 http://www.forwardsoft.net 欢迎使用安瑞尔短信开发控件 您的支持是我们成长的动力 "
ForeColor = &H000000FF&
Height = 375
Left = 0
TabIndex = 24
Top = 4440
Width = 5655
End
End
Attribute VB_Name = "frmDemo"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
'//////////////////////////////////////////////////////
'
'
' 本程序展示了短信控件的核心功能
' 欢迎你使用安瑞尔短信开发控件,您的支持是我们成长的动力!
' http://www.forwardsoft.net
' 版权所有:安瑞尔科技(北京)有限公司
' 如果你再使用过程有什么意见或建议,请邮件至sms@arrower.com,主题请注明“安瑞尔短信控件”
'
'
'//////////////////////////////////////////////////////
Private Sub ArrowerSMS1_ReceiveMsg(Pos As String)
Dim OA As String
Dim Msg As String
Dim Time As String
If ArrowerSMS1.ReadMsg(OA, Msg, Time) = 0 Then
txtRec.Text = txtRec.Text & "存储位置:" & Pos & vbCrLf & "时间:" & Time & vbCrLf & "来自:" & OA & vbCrLf & "内容:" & Msg & vbCrLf
End If
End Sub
Private Sub ArrowerSMS1_StatusReport(SMSNO As Integer, ToPhone As String, SubmitTime As String, SentTime As String)
txtRec.Text = txtRec.Text & "状态报告" & vbCrLf & SMSNO & vbCrLf & ToPhone & vbCrLf & SubmitTime & vbCrLf & SentTime & vbCrLf
End Sub
Private Sub chkStatusReport_Click()
If chkStatusReport.Value = 1 Then
ArrowerSMS1.isStatusReport = True
Else
ArrowerSMS1.isStatusReport = False
End If
End Sub
Private Sub cmdAbout_Click()
ArrowerSMS1.ShowAboutBox
End Sub
Private Sub cmdConnect_Click()
ArrowerSMS1.CommPort = Val(TxtCom.Text)
ArrowerSMS1.CenterNo = Trim(txtCenterNo.Text)
If ArrowerSMS1.OpenCom = 0 Then
cmdDisConnect.Enabled = True
cmdRead.Enabled = True
cmdSend.Enabled = True
cmdConnect.Enabled = False
MsgBox "设备打开成功"
Else
MsgBox "设备打开失败"
End If
End Sub
Private Sub cmdDisConnect_Click()
If ArrowerSMS1.CloseCom = 0 Then
MsgBox "设备关闭成功"
cmdDisConnect.Enabled = False
cmdRead.Enabled = False
cmdSend.Enabled = False
cmdConnect.Enabled = True
Else
MsgBox "设备关闭失败"
End If
End Sub
Private Sub cmdExit_Click()
Unload Me
End Sub
Private Sub cmdRead_Click()
Dim OA As String
Dim Msg As String
Dim Time As String
If ArrowerSMS1.ReadMsgForIndex(OA, Msg, Time, txtSMSNo.Text) = 0 Then
txtReadResult.Text = "内容:" & Msg
Else
txtReadResult.Text = "该位置无短信!"
End If
End Sub
Private Sub ChkFlash_Click()
If ChkFlash.Value = 1 Then
ArrowerSMS1.IsFlash = True
Else
ArrowerSMS1.IsFlash = False
End If
End Sub
Private Sub chkWap_Click()
If chkWap.Value = 1 Then
lblUrl.Visible = True
txtUrl.Visible = True
lblSub.Caption = "主题"
txtmsg.Height = 795
Else
lblUrl.Visible = False
txtUrl.Visible = False
lblSub.Caption = "短信内容"
txtmsg.Height = 1275
End If
End Sub
Private Sub cmdSend_Click()
If chkWap.Value = 1 Then
If ArrowerSMS1.SendWapPush(txtMobileNo.Text, txtmsg.Text, txtUrl.Text) > 0 Then
MsgBox "发送成功"
Else
MsgBox "发送失败"
End If
Else
If ArrowerSMS1.SendMsg(txtMobileNo.Text, txtmsg.Text) > 0 Then
MsgBox "发送成功"
Else
MsgBox "发送失败"
End If
End If
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -