📄 frmdemo.frm
字号:
VERSION 5.00
Object = "{B3D7B9D2-F8D1-45B1-ABAE-3E9390251B24}#1.0#0"; "JindiSMSControl.ocx"
Begin VB.Form frmDemo
BorderStyle = 1 'Fixed Single
Caption = "金笛短信控件使用示例(vb6.0)"
ClientHeight = 4890
ClientLeft = 45
ClientTop = 330
ClientWidth = 7410
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 = 7410
StartUpPosition = 2 '屏幕中心
Begin VB.Frame Frame4
Caption = "读短信"
Height = 615
Left = 0
TabIndex = 14
Top = 3720
Width = 7305
Begin VB.TextBox txtReadResult
Height = 300
Left = 2700
TabIndex = 18
Top = 210
Width = 4545
End
Begin VB.CommandButton cmdRead
Caption = "读短信(&R)"
Height = 345
Left = 1560
TabIndex = 17
Top = 180
Width = 1095
End
Begin VB.TextBox txtSMSNo
Height = 300
Left = 930
TabIndex = 16
Top = 210
Width = 555
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 = 840
Width = 3615
Begin VB.TextBox txtRec
Height = 2355
Left = 60
MultiLine = -1 'True
TabIndex = 11
Top = 360
Width = 3495
End
End
Begin VB.Frame Frame2
Caption = "发短信"
Height = 2775
Left = 0
TabIndex = 6
Top = 840
Width = 3585
Begin JDSMSCtrl.JindiSMSControl JindiSMSControl1
Height = 375
Left = 240
TabIndex = 25
Top = 2160
Visible = 0 'False
Width = 375
_ExtentX = 661
_ExtentY = 661
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)"
Height = 345
Left = 2430
TabIndex = 13
Top = 2130
Width = 1035
End
Begin VB.TextBox txtMobileNo
Height = 270
Left = 870
TabIndex = 10
Text = "13331012788"
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 = 675
Left = 30
TabIndex = 0
Top = 120
Width = 7245
Begin VB.TextBox TxtCom
Height = 270
Left = 3960
TabIndex = 19
Text = "1"
Top = 240
Width = 975
End
Begin VB.CommandButton cmdDisConnect
Caption = "断开(&D)"
Height = 285
Left = 6120
TabIndex = 5
Top = 240
Width = 975
End
Begin VB.CommandButton cmdConnect
Caption = "连接(&C)"
Height = 285
Left = 5160
TabIndex = 4
Top = 240
Width = 975
End
Begin VB.TextBox txtCenterNo
Alignment = 1 'Right Justify
Height = 270
Left = 1260
TabIndex = 1
Text = "+8613800100500"
Top = 240
Width = 1665
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 = 3090
TabIndex = 2
Top = 240
Width = 810
End
End
Begin VB.Label Label2
Alignment = 2 'Center
BorderStyle = 1 'Fixed Single
Caption = "北京春笛信息技术有限公司 http://www.sendsms.cn"
Height = 375
Left = 75
TabIndex = 24
Top = 4440
Width = 7215
End
End
Attribute VB_Name = "frmDemo"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
'//////////////////////////////////////////////////////
'
'
'本程序展示了短信控件的核心功能
'
'
'//////////////////////////////////////////////////////
Private Sub ChkFlash_Click()
If ChkFlash.Value = 1 Then
JindiSMSControl1.IsFlash = True
Else
JindiSMSControl1.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 CmdAT_Click()
TxtRe.Text = TxtRe.Text & JindiSMSControl1.ATCommand(TxtAT.Text)
End Sub
Private Sub cmdConnect_Click()
JindiSMSControl1.CommPort = Val(TxtCom.Text)
JindiSMSControl1.CenterNo = Trim(txtCenterNo.Text)
If JindiSMSControl1.OpenCom = 0 Then
MsgBox "设备打开成功"
Else
MsgBox "设备打开失败"
End If
End Sub
Private Sub cmdDisConnect_Click()
If JindiSMSControl1.CloseCom = 0 Then
MsgBox "设备关闭成功"
Else
MsgBox "设备关闭失败"
End If
End Sub
Private Sub cmdRead_Click()
Dim OA As String
Dim Msg As String
Dim Time As String
If JindiSMSControl1.ReadMsgForIndex(OA, Msg, Time, txtSMSNo.Text) = 0 Then
txtReadResult.Text = "内容:" & Msg
End If
End Sub
Private Sub cmdSend_Click()
If chkWap.Value = 1 Then
If JindiSMSControl1.SendWapPush(txtMobileNo.Text, txtmsg.Text, txtUrl.Text) = 0 Then
MsgBox "发送成功"
Else
MsgBox "发送失败"
End If
Else
If JindiSMSControl1.SendMsg(txtMobileNo.Text, txtmsg.Text) = 0 Then
MsgBox "发送成功"
Else
MsgBox "发送失败"
End If
End If
End Sub
Private Sub JindiSMSControl1_ReceiveMsg()
Dim OA As String
Dim Msg As String
Dim Time As String
If JindiSMSControl1.ReadMsg(OA, Msg, Time) = 0 Then
txtRec.Text = txtRec.Text & "时间:" & Time & vbCrLf & "来自:" & OA & vbCrLf & "内容:" & Msg & vbCrLf
End If
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -