⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 form1.frm

📁 异步短信控件vb示例 .rar异步短信控件vb示例
💻 FRM
字号:
VERSION 5.00
Object = "{E69A8DCA-B4EE-4D71-938A-7652059D24B7}#1.0#0"; "EdisonSmsGw.ocx"
Begin VB.Form Form1 
   Caption         =   "Form1"
   ClientHeight    =   4680
   ClientLeft      =   60
   ClientTop       =   345
   ClientWidth     =   6210
   LinkTopic       =   "Form1"
   ScaleHeight     =   4680
   ScaleWidth      =   6210
   StartUpPosition =   3  'Windows Default
   Begin VB.ComboBox ComRate_Combo 
      Height          =   315
      ItemData        =   "Form1.frx":0000
      Left            =   3960
      List            =   "Form1.frx":000D
      TabIndex        =   13
      Text            =   "115200"
      Top             =   840
      Width           =   1095
   End
   Begin VB.CommandButton Send_btn 
      Caption         =   "发送"
      Height          =   375
      Left            =   1680
      TabIndex        =   10
      Top             =   4080
      Width           =   855
   End
   Begin VB.TextBox SMS_Text 
      Height          =   1215
      Left            =   1680
      MultiLine       =   -1  'True
      ScrollBars      =   2  'Vertical
      TabIndex        =   9
      Top             =   2760
      Width           =   3375
   End
   Begin VB.TextBox Number_Text 
      Height          =   375
      Left            =   1680
      TabIndex        =   7
      Top             =   2040
      Width           =   3375
   End
   Begin VB.CommandButton DisConnectModem_btn 
      Caption         =   "断开连接"
      Height          =   375
      Left            =   4080
      TabIndex        =   5
      Top             =   1320
      Width           =   975
   End
   Begin VB.CommandButton ConnectModem_btn 
      Caption         =   "连接设备"
      Height          =   375
      Left            =   1680
      TabIndex        =   4
      Top             =   1320
      Width           =   975
   End
   Begin VB.ComboBox COM_Combo 
      Height          =   315
      ItemData        =   "Form1.frx":0026
      Left            =   1680
      List            =   "Form1.frx":0042
      TabIndex        =   1
      Text            =   "COM1"
      Top             =   840
      Width           =   1215
   End
   Begin EDISONSMSGWLib.EdisonSmsGw EdisonSmsGw1 
      Height          =   255
      Left            =   3960
      TabIndex        =   0
      Top             =   0
      Visible         =   0   'False
      Width           =   735
      _Version        =   65536
      _ExtentX        =   1296
      _ExtentY        =   450
      _StockProps     =   0
   End
   Begin VB.Label Label5 
      Caption         =   "波特率:"
      Height          =   255
      Left            =   3120
      TabIndex        =   12
      Top             =   840
      Width           =   735
   End
   Begin VB.Label Label4 
      Caption         =   "串口:"
      Height          =   255
      Left            =   720
      TabIndex        =   11
      Top             =   840
      Width           =   735
   End
   Begin VB.Label Label3 
      Caption         =   "短信内容:"
      Height          =   255
      Left            =   720
      TabIndex        =   8
      Top             =   2760
      Width           =   975
   End
   Begin VB.Label Label2 
      Caption         =   "接收号码:"
      Height          =   255
      Left            =   720
      TabIndex        =   6
      Top             =   2040
      Width           =   975
   End
   Begin VB.Label state 
      Height          =   375
      Left            =   1440
      TabIndex        =   3
      Top             =   240
      Width           =   3615
   End
   Begin VB.Label Label1 
      Caption         =   "状态:"
      Height          =   255
      Left            =   720
      TabIndex        =   2
      Top             =   240
      Width           =   615
   End
End
Attribute VB_Name = "Form1"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Sub ConnectModem_btn_Click()
n = EdisonSmsGw1.ConnectModem(COM_Combo.Text, ComRate_Combo.Text, 1)
If n = 1 Then
state.Caption = "已打开串口,正在连接"
End If
If n = -1 Then
state.Caption = "打开串口失败"
End If
End Sub

Private Sub DisConnectModem_btn_Click()
EdisonSmsGw1.DisconnectModem
state.Caption = "已断开连接"
End Sub

Private Sub Form_Load()
EdisonSmsGw1.SetModemType ("1")
End Sub

Private Sub Send_btn_Click()
If Number_Text.Text = "" Then
MsgBox "请输入接收手机号码", 48, "提示"
Exit Sub
End If
If SMS_Text.Text = "" Then
MsgBox "请输入短信内容", 48, "提示"
Exit Sub
End If
n = EdisonSmsGw1.SendSms(Number_Text.Text, SMS_Text.Text, 1)
If n = 1 Then
state.Caption = "已加入到发送队列"
Else
state.Caption = "提交短信失败"
End If
End Sub

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -