📄 form1.vb
字号:
Imports System.io
Public Class Form1
Inherits System.Windows.Forms.Form
Public buf, BUF1, BUF2, BUF3 As String
Public sms_len_int As Integer
Public total_sms As String '完整的消息内容
Public i As Integer = 0
Public ms_count As Integer
Public sms, msg As String
Public sms_center As String
Public sms_len As String
#Region " Windows 窗体设计器生成的代码 "
Public Sub New()
MyBase.New()
'该调用是 Windows 窗体设计器所必需的。
InitializeComponent()
'在 InitializeComponent() 调用之后添加任何初始化
End Sub
'窗体重写 dispose 以清理组件列表。
Protected Overloads Overrides Sub Dispose(ByVal disposing As Boolean)
If disposing Then
If Not (components Is Nothing) Then
components.Dispose()
End If
End If
MyBase.Dispose(disposing)
End Sub
'Windows 窗体设计器所必需的
Private components As System.ComponentModel.IContainer
'注意: 以下过程是 Windows 窗体设计器所必需的
'可以使用 Windows 窗体设计器修改此过程。
'不要使用代码编辑器修改它。
Friend WithEvents GroupBox1 As System.Windows.Forms.GroupBox
Friend WithEvents Label1 As System.Windows.Forms.Label
Friend WithEvents ComboBox1 As System.Windows.Forms.ComboBox
Friend WithEvents Label2 As System.Windows.Forms.Label
Friend WithEvents TextBox1 As System.Windows.Forms.TextBox
Friend WithEvents Button1 As System.Windows.Forms.Button
Friend WithEvents Button2 As System.Windows.Forms.Button
Friend WithEvents GroupBox2 As System.Windows.Forms.GroupBox
Friend WithEvents ListBox1 As System.Windows.Forms.ListBox
Friend WithEvents Label3 As System.Windows.Forms.Label
Friend WithEvents Button3 As System.Windows.Forms.Button
Friend WithEvents Button4 As System.Windows.Forms.Button
Friend WithEvents TextBox2 As System.Windows.Forms.TextBox
Friend WithEvents Label4 As System.Windows.Forms.Label
Friend WithEvents TextBox3 As System.Windows.Forms.TextBox
Friend WithEvents Label5 As System.Windows.Forms.Label
Friend WithEvents Button5 As System.Windows.Forms.Button
Friend WithEvents Button7 As System.Windows.Forms.Button
Friend WithEvents msComm1 As AxMSCommLib.AxMSComm
Friend WithEvents OpenFileDialog1 As System.Windows.Forms.OpenFileDialog
Friend WithEvents Label6 As System.Windows.Forms.Label
Friend WithEvents Label7 As System.Windows.Forms.Label
Friend WithEvents ComboBox2 As System.Windows.Forms.ComboBox
Friend WithEvents Label8 As System.Windows.Forms.Label
Friend WithEvents Label9 As System.Windows.Forms.Label
Friend WithEvents Timer1 As System.Windows.Forms.Timer
<System.Diagnostics.DebuggerStepThrough()> Private Sub InitializeComponent()
Me.components = New System.ComponentModel.Container
Dim resources As System.Resources.ResourceManager = New System.Resources.ResourceManager(GetType(Form1))
Me.GroupBox1 = New System.Windows.Forms.GroupBox
Me.msComm1 = New AxMSCommLib.AxMSComm
Me.Button2 = New System.Windows.Forms.Button
Me.Button1 = New System.Windows.Forms.Button
Me.TextBox1 = New System.Windows.Forms.TextBox
Me.Label2 = New System.Windows.Forms.Label
Me.ComboBox1 = New System.Windows.Forms.ComboBox
Me.Label1 = New System.Windows.Forms.Label
Me.GroupBox2 = New System.Windows.Forms.GroupBox
Me.Label6 = New System.Windows.Forms.Label
Me.Button5 = New System.Windows.Forms.Button
Me.Label5 = New System.Windows.Forms.Label
Me.TextBox3 = New System.Windows.Forms.TextBox
Me.Label4 = New System.Windows.Forms.Label
Me.TextBox2 = New System.Windows.Forms.TextBox
Me.Button4 = New System.Windows.Forms.Button
Me.Button3 = New System.Windows.Forms.Button
Me.Label3 = New System.Windows.Forms.Label
Me.ListBox1 = New System.Windows.Forms.ListBox
Me.Button7 = New System.Windows.Forms.Button
Me.OpenFileDialog1 = New System.Windows.Forms.OpenFileDialog
Me.Label7 = New System.Windows.Forms.Label
Me.ComboBox2 = New System.Windows.Forms.ComboBox
Me.Label8 = New System.Windows.Forms.Label
Me.Label9 = New System.Windows.Forms.Label
Me.Timer1 = New System.Windows.Forms.Timer(Me.components)
Me.GroupBox1.SuspendLayout()
CType(Me.msComm1, System.ComponentModel.ISupportInitialize).BeginInit()
Me.GroupBox2.SuspendLayout()
Me.SuspendLayout()
'
'GroupBox1
'
Me.GroupBox1.Controls.Add(Me.msComm1)
Me.GroupBox1.Controls.Add(Me.Button2)
Me.GroupBox1.Controls.Add(Me.Button1)
Me.GroupBox1.Controls.Add(Me.TextBox1)
Me.GroupBox1.Controls.Add(Me.Label2)
Me.GroupBox1.Controls.Add(Me.ComboBox1)
Me.GroupBox1.Controls.Add(Me.Label1)
Me.GroupBox1.Location = New System.Drawing.Point(8, 8)
Me.GroupBox1.Name = "GroupBox1"
Me.GroupBox1.Size = New System.Drawing.Size(512, 48)
Me.GroupBox1.TabIndex = 0
Me.GroupBox1.TabStop = False
Me.GroupBox1.Text = "连接手机"
'
'msComm1
'
Me.msComm1.ContainingControl = Me
Me.msComm1.Enabled = True
Me.msComm1.Location = New System.Drawing.Point(136, 8)
Me.msComm1.Name = "msComm1"
Me.msComm1.OcxState = CType(resources.GetObject("msComm1.OcxState"), System.Windows.Forms.AxHost.State)
Me.msComm1.Size = New System.Drawing.Size(38, 38)
Me.msComm1.TabIndex = 7
'
'Button2
'
Me.Button2.Enabled = False
Me.Button2.Location = New System.Drawing.Point(440, 16)
Me.Button2.Name = "Button2"
Me.Button2.Size = New System.Drawing.Size(64, 23)
Me.Button2.TabIndex = 5
Me.Button2.Text = "断开"
'
'Button1
'
Me.Button1.Location = New System.Drawing.Point(360, 16)
Me.Button1.Name = "Button1"
Me.Button1.Size = New System.Drawing.Size(72, 23)
Me.Button1.TabIndex = 4
Me.Button1.Text = "连接"
'
'TextBox1
'
Me.TextBox1.Location = New System.Drawing.Point(240, 16)
Me.TextBox1.Name = "TextBox1"
Me.TextBox1.ReadOnly = True
Me.TextBox1.Size = New System.Drawing.Size(96, 21)
Me.TextBox1.TabIndex = 3
Me.TextBox1.Text = "8613800830500"
'
'Label2
'
Me.Label2.Font = New System.Drawing.Font("宋体", 9.0!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
Me.Label2.Location = New System.Drawing.Point(152, 24)
Me.Label2.Name = "Label2"
Me.Label2.Size = New System.Drawing.Size(96, 16)
Me.Label2.TabIndex = 2
Me.Label2.Text = "短信中心号码:"
'
'ComboBox1
'
Me.ComboBox1.Font = New System.Drawing.Font("宋体", 9.0!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
Me.ComboBox1.Items.AddRange(New Object() {"COM1", "COM2", "COM3", "COM4", "COM5", "COM6", "COM7", "COM8", "COM9"})
Me.ComboBox1.Location = New System.Drawing.Point(72, 16)
Me.ComboBox1.Name = "ComboBox1"
Me.ComboBox1.Size = New System.Drawing.Size(64, 20)
Me.ComboBox1.TabIndex = 1
'
'Label1
'
Me.Label1.Font = New System.Drawing.Font("宋体", 9.0!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
Me.Label1.Location = New System.Drawing.Point(8, 24)
Me.Label1.Name = "Label1"
Me.Label1.Size = New System.Drawing.Size(72, 16)
Me.Label1.TabIndex = 0
Me.Label1.Text = "串口选择:"
'
'GroupBox2
'
Me.GroupBox2.Controls.Add(Me.Label6)
Me.GroupBox2.Controls.Add(Me.Button5)
Me.GroupBox2.Controls.Add(Me.Label5)
Me.GroupBox2.Controls.Add(Me.TextBox3)
Me.GroupBox2.Controls.Add(Me.Label4)
Me.GroupBox2.Controls.Add(Me.TextBox2)
Me.GroupBox2.Controls.Add(Me.Button4)
Me.GroupBox2.Controls.Add(Me.Button3)
Me.GroupBox2.Controls.Add(Me.Label3)
Me.GroupBox2.Controls.Add(Me.ListBox1)
Me.GroupBox2.Location = New System.Drawing.Point(8, 64)
Me.GroupBox2.Name = "GroupBox2"
Me.GroupBox2.Size = New System.Drawing.Size(512, 280)
Me.GroupBox2.TabIndex = 1
Me.GroupBox2.TabStop = False
Me.GroupBox2.Text = "发送短信"
'
'Label6
'
Me.Label6.Font = New System.Drawing.Font("宋体", 10.5!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(134, Byte))
Me.Label6.Location = New System.Drawing.Point(160, 256)
Me.Label6.Name = "Label6"
Me.Label6.Size = New System.Drawing.Size(168, 16)
Me.Label6.TabIndex = 9
Me.Label6.Text = "发送成功率受网络影响!"
'
'Button5
'
Me.Button5.Enabled = False
Me.Button5.Location = New System.Drawing.Point(328, 248)
Me.Button5.Name = "Button5"
Me.Button5.Size = New System.Drawing.Size(176, 25)
Me.Button5.TabIndex = 8
Me.Button5.Text = "发送短信"
'
'Label5
'
Me.Label5.Location = New System.Drawing.Point(160, 136)
Me.Label5.Name = "Label5"
Me.Label5.Size = New System.Drawing.Size(176, 16)
Me.Label5.TabIndex = 7
Me.Label5.Text = "发送状态:"
'
'TextBox3
'
Me.TextBox3.Font = New System.Drawing.Font("宋体", 10.5!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(134, Byte))
Me.TextBox3.Location = New System.Drawing.Point(160, 152)
Me.TextBox3.Multiline = True
Me.TextBox3.Name = "TextBox3"
Me.TextBox3.ScrollBars = System.Windows.Forms.ScrollBars.Both
Me.TextBox3.Size = New System.Drawing.Size(344, 96)
Me.TextBox3.TabIndex = 6
Me.TextBox3.Text = ""
'
'Label4
'
Me.Label4.Location = New System.Drawing.Point(160, 16)
Me.Label4.Name = "Label4"
Me.Label4.Size = New System.Drawing.Size(176, 16)
Me.Label4.TabIndex = 5
Me.Label4.Text = "短信内容(不超过70个字符):"
'
'TextBox2
'
Me.TextBox2.Font = New System.Drawing.Font("宋体", 10.5!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(134, Byte))
Me.TextBox2.Location = New System.Drawing.Point(160, 32)
Me.TextBox2.Multiline = True
Me.TextBox2.Name = "TextBox2"
Me.TextBox2.ScrollBars = System.Windows.Forms.ScrollBars.Both
Me.TextBox2.Size = New System.Drawing.Size(344, 96)
Me.TextBox2.TabIndex = 4
Me.TextBox2.Text = ""
'
'Button4
'
Me.Button4.Location = New System.Drawing.Point(80, 248)
Me.Button4.Name = "Button4"
Me.Button4.Size = New System.Drawing.Size(72, 25)
Me.Button4.TabIndex = 3
Me.Button4.Text = "清除"
'
'Button3
'
Me.Button3.Location = New System.Drawing.Point(8, 248)
Me.Button3.Name = "Button3"
Me.Button3.Size = New System.Drawing.Size(64, 25)
Me.Button3.TabIndex = 2
Me.Button3.Text = "导入"
'
'Label3
'
Me.Label3.Location = New System.Drawing.Point(8, 16)
Me.Label3.Name = "Label3"
Me.Label3.Size = New System.Drawing.Size(168, 16)
Me.Label3.TabIndex = 1
Me.Label3.Text = "目标号码(小灵通加区号):"
'
'ListBox1
'
Me.ListBox1.Font = New System.Drawing.Font("宋体", 10.5!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(134, Byte))
Me.ListBox1.ItemHeight = 14
Me.ListBox1.Location = New System.Drawing.Point(8, 32)
Me.ListBox1.Name = "ListBox1"
Me.ListBox1.Size = New System.Drawing.Size(144, 214)
Me.ListBox1.TabIndex = 0
'
'Button7
'
Me.Button7.Location = New System.Drawing.Point(432, 352)
Me.Button7.Name = "Button7"
Me.Button7.Size = New System.Drawing.Size(88, 25)
Me.Button7.TabIndex = 2
Me.Button7.Text = "退出"
'
'Label7
'
Me.Label7.Font = New System.Drawing.Font("宋体", 10.5!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(134, Byte))
Me.Label7.Location = New System.Drawing.Point(8, 352)
Me.Label7.Name = "Label7"
Me.Label7.Size = New System.Drawing.Size(112, 23)
Me.Label7.TabIndex = 3
Me.Label7.Text = "发送时间间隔:"
'
'ComboBox2
'
Me.ComboBox2.Font = New System.Drawing.Font("宋体", 10.5!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(134, Byte))
Me.ComboBox2.Items.AddRange(New Object() {"1", "2", "3", "4", "5", "6", "7", "8", "9", "10"})
Me.ComboBox2.Location = New System.Drawing.Point(104, 352)
Me.ComboBox2.Name = "ComboBox2"
Me.ComboBox2.Size = New System.Drawing.Size(40, 22)
Me.ComboBox2.TabIndex = 4
Me.ComboBox2.Text = "1"
'
'Label8
'
Me.Label8.Font = New System.Drawing.Font("宋体", 10.5!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(134, Byte))
Me.Label8.Location = New System.Drawing.Point(144, 352)
Me.Label8.Name = "Label8"
Me.Label8.Size = New System.Drawing.Size(24, 23)
Me.Label8.TabIndex = 5
Me.Label8.Text = "秒"
'
'Label9
'
Me.Label9.Font = New System.Drawing.Font("宋体", 10.5!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(134, Byte))
Me.Label9.Location = New System.Drawing.Point(160, 352)
Me.Label9.Name = "Label9"
Me.Label9.Size = New System.Drawing.Size(280, 16)
Me.Label9.TabIndex = 10
Me.Label9.Text = "(发送成功率比较低时,请增加时间间隔。)"
'
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -