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

📄 form1.frm

📁 短信开发控件
💻 FRM
字号:
VERSION 5.00
Begin VB.Form Form1 
   BorderStyle     =   1  'Fixed Single
   Caption         =   "《月影短信》编程接口示例"
   ClientHeight    =   4245
   ClientLeft      =   45
   ClientTop       =   330
   ClientWidth     =   7155
   LinkTopic       =   "Form1"
   MaxButton       =   0   'False
   ScaleHeight     =   4245
   ScaleWidth      =   7155
   StartUpPosition =   2  '屏幕中心
   Begin VB.CommandButton cmdSend 
      Caption         =   "发送短信"
      Height          =   300
      Left            =   5910
      TabIndex        =   14
      Top             =   2505
      Width           =   1000
   End
   Begin VB.TextBox edtSms 
      Height          =   1245
      Left            =   1020
      MultiLine       =   -1  'True
      ScrollBars      =   2  'Vertical
      TabIndex        =   13
      Top             =   1995
      Width           =   4800
   End
   Begin VB.TextBox txtNickName 
      Height          =   300
      Left            =   3825
      TabIndex        =   11
      Top             =   1545
      Width           =   2000
   End
   Begin VB.TextBox txtPhone 
      Height          =   300
      Left            =   1020
      TabIndex        =   9
      Top             =   1545
      Width           =   2000
   End
   Begin VB.TextBox txtPassword 
      Height          =   300
      IMEMode         =   3  'DISABLE
      Left            =   3825
      PasswordChar    =   "*"
      TabIndex        =   7
      Top             =   1140
      Width           =   2000
   End
   Begin VB.TextBox txtUserName 
      Height          =   300
      Left            =   1020
      TabIndex        =   6
      Top             =   1140
      Width           =   2000
   End
   Begin VB.ComboBox cmbGateway 
      Height          =   300
      Left            =   1020
      Style           =   2  'Dropdown List
      TabIndex        =   3
      Top             =   720
      Width           =   4800
   End
   Begin VB.CommandButton cmdRefresh 
      Caption         =   "刷新列表"
      Height          =   300
      Left            =   5910
      TabIndex        =   2
      Top             =   720
      Width           =   1000
   End
   Begin VB.Label lblError 
      BackColor       =   &H80000018&
      Caption         =   "发送结果:"
      ForeColor       =   &H00FF0000&
      Height          =   195
      Left            =   787
      TabIndex        =   15
      Top             =   3570
      Width           =   5580
   End
   Begin VB.Label Label7 
      AutoSize        =   -1  'True
      Caption         =   "短信内容"
      Height          =   180
      Left            =   270
      TabIndex        =   12
      Top             =   2055
      Width           =   720
   End
   Begin VB.Label Label6 
      AutoSize        =   -1  'True
      Caption         =   "使用昵称"
      Height          =   180
      Left            =   3075
      TabIndex        =   10
      Top             =   1605
      Width           =   720
   End
   Begin VB.Label Label5 
      AutoSize        =   -1  'True
      Caption         =   "对方手机"
      Height          =   180
      Left            =   270
      TabIndex        =   8
      Top             =   1605
      Width           =   720
   End
   Begin VB.Label Label4 
      AutoSize        =   -1  'True
      Caption         =   "登录密码"
      Height          =   180
      Left            =   3075
      TabIndex        =   5
      Top             =   1200
      Width           =   720
   End
   Begin VB.Label Label3 
      AutoSize        =   -1  'True
      Caption         =   "登录账号"
      Height          =   180
      Left            =   270
      TabIndex        =   4
      Top             =   1200
      Width           =   720
   End
   Begin VB.Label Label2 
      AutoSize        =   -1  'True
      Caption         =   "选择网关"
      Height          =   180
      Left            =   270
      TabIndex        =   1
      Top             =   780
      Width           =   705
   End
   Begin VB.Label Label1 
      BackColor       =   &H80000018&
      Caption         =   "注意:请将 kkstar_sms.dll 拷贝到 Windows 系统的 system 目录中。"
      ForeColor       =   &H00FF0000&
      Height          =   200
      Left            =   780
      TabIndex        =   0
      Top             =   240
      Width           =   5670
   End
End
Attribute VB_Name = "Form1"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False

Private Sub cmdRefresh_Click()

Dim s As String
Dim aStr() As String

s = GetGatewayList()
aStr = Split(s, Chr$(13) + Chr$(10))

cmbGateway.Clear
For i = LBound(aStr) To UBound(aStr) - 1
  cmbGateway.AddItem aStr(i)
Next
cmbGateway.Text = cmbGateway.List(0)

End Sub

Private Sub cmdSend_Click()

Dim cGateWay, cUserName, cPassword, cPhone, cContent, cNickName, cExtent, cError As String

cGateWay = Trim(Left(cmbGateway.Text, 16))
cUserName = Trim(txtUserName.Text)
cPassword = Trim(txtPassword.Text)
cPhone = Trim(txtPhone.Text)
cContent = edtSms.Text
cNickName = Trim(txtNickName.Text)
cExtent = ""

If Len(cGateWay) > 0 And Len(cUserName) > 0 And Len(cPhone) > 0 And Len(cContent) > 0 Then
  lblError.Caption = ""
  cError = SendSms(ByVal cGateWay, ByVal cUserName, ByVal cPassword, ByVal cPhone, ByVal cContent, ByVal cNickName, ByVal cExtent)
  lblError.Caption = cError
End If

End Sub

⌨️ 快捷键说明

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