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

📄 form1.vb

📁 手机短信PDU编码解码函数
💻 VB
字号:
Public Class Form1
    Inherits System.Windows.Forms.Form

#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 Panel1 As System.Windows.Forms.Panel
    Friend WithEvents Splitter1 As System.Windows.Forms.Splitter
    Friend WithEvents Splitter2 As System.Windows.Forms.Splitter
    Friend WithEvents Button1 As System.Windows.Forms.Button
    Friend WithEvents txtPDU As System.Windows.Forms.TextBox
    Friend WithEvents txtGB As System.Windows.Forms.TextBox
    <System.Diagnostics.DebuggerStepThrough()> Private Sub InitializeComponent()
        Me.Panel1 = New System.Windows.Forms.Panel
        Me.txtPDU = New System.Windows.Forms.TextBox
        Me.Splitter1 = New System.Windows.Forms.Splitter
        Me.txtGB = New System.Windows.Forms.TextBox
        Me.Splitter2 = New System.Windows.Forms.Splitter
        Me.Button1 = New System.Windows.Forms.Button
        Me.Panel1.SuspendLayout()
        Me.SuspendLayout()
        '
        'Panel1
        '
        Me.Panel1.Controls.Add(Me.Button1)
        Me.Panel1.Controls.Add(Me.Splitter2)
        Me.Panel1.Controls.Add(Me.txtPDU)
        Me.Panel1.Dock = System.Windows.Forms.DockStyle.Top
        Me.Panel1.Location = New System.Drawing.Point(0, 0)
        Me.Panel1.Name = "Panel1"
        Me.Panel1.Size = New System.Drawing.Size(520, 72)
        Me.Panel1.TabIndex = 1
        '
        'txtPDU
        '
        Me.txtPDU.Dock = System.Windows.Forms.DockStyle.Left
        Me.txtPDU.Location = New System.Drawing.Point(0, 0)
        Me.txtPDU.Multiline = True
        Me.txtPDU.Name = "txtPDU"
        Me.txtPDU.ScrollBars = System.Windows.Forms.ScrollBars.Vertical
        Me.txtPDU.Size = New System.Drawing.Size(368, 72)
        Me.txtPDU.TabIndex = 1
        Me.txtPDU.Text = ""
        '
        'Splitter1
        '
        Me.Splitter1.Dock = System.Windows.Forms.DockStyle.Top
        Me.Splitter1.Location = New System.Drawing.Point(0, 72)
        Me.Splitter1.Name = "Splitter1"
        Me.Splitter1.Size = New System.Drawing.Size(520, 8)
        Me.Splitter1.TabIndex = 2
        Me.Splitter1.TabStop = False
        '
        'txtGB
        '
        Me.txtGB.Dock = System.Windows.Forms.DockStyle.Fill
        Me.txtGB.Location = New System.Drawing.Point(0, 80)
        Me.txtGB.Multiline = True
        Me.txtGB.Name = "txtGB"
        Me.txtGB.ScrollBars = System.Windows.Forms.ScrollBars.Vertical
        Me.txtGB.Size = New System.Drawing.Size(520, 283)
        Me.txtGB.TabIndex = 3
        Me.txtGB.Text = ""
        '
        'Splitter2
        '
        Me.Splitter2.Location = New System.Drawing.Point(368, 0)
        Me.Splitter2.Name = "Splitter2"
        Me.Splitter2.Size = New System.Drawing.Size(8, 72)
        Me.Splitter2.TabIndex = 2
        Me.Splitter2.TabStop = False
        '
        'Button1
        '
        Me.Button1.Location = New System.Drawing.Point(416, 16)
        Me.Button1.Name = "Button1"
        Me.Button1.Size = New System.Drawing.Size(96, 24)
        Me.Button1.TabIndex = 3
        Me.Button1.Text = "Button1"
        '
        'Form1
        '
        Me.AutoScaleBaseSize = New System.Drawing.Size(6, 14)
        Me.ClientSize = New System.Drawing.Size(520, 363)
        Me.Controls.Add(Me.txtGB)
        Me.Controls.Add(Me.Splitter1)
        Me.Controls.Add(Me.Panel1)
        Me.Name = "Form1"
        Me.Text = "Form1"
        Me.Panel1.ResumeLayout(False)
        Me.ResumeLayout(False)

    End Sub

#End Region

    Private Sub TextBox2_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs)

    End Sub

    Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load

    End Sub

    Private Sub Button1_Click_1(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
        Try
            Dim s As Object
            Dim PDUCode As String = txtPDU.Text
            Dim T As SMS.SMSType = SMS.GetSMSType(PDUCode)
            txtGB.Text = txtGB.Text + T.ToString + vbCrLf
            Select Case T
                Case SMS.SMSType.EMS_RECEIVED
                    s = New EMS_RECEIVED(PDUCode)
                    txtGB.Text += "来自:" + s.SrcAddressValue + "  时间:" + s.TP_SCTS + vbCrLf + vbCrLf
                Case SMS.SMSType.SMS_RECEIVED
                    s = New SMS_RECEIVED(PDUCode)
                    txtGB.Text += "来自:" + s.SrcAddressValue + "  时间:" + s.TP_SCTS + vbCrLf + vbCrLf
                Case SMS.SMSType.EMS_SUBMIT
                    s = New EMS_SUBMIT(PDUCode)
                    txtGB.Text += "发送至:" + s.DesAddressValue + vbCrLf + vbCrLf
                Case SMS.SMSType.SMS_SUBMIT
                    s = New SMS_SUBMIT(PDUCode)
                    txtGB.Text += "发送至:" + s.DesAddressValue + vbCrLf + vbCrLf
                Case SMS.SMSType.SMS_STATUS_REPORT
                    s = New SMS_STATUS_REPORT(PDUCode)
                    txtGB.Text += "发送时间:" + s.TP_SCTS + "  接受时间:" + s.TP_DP + "   状态:" + s.status + vbCrLf + vbCrLf
                Case Else
                    Stop
            End Select


            txtGB.Text = txtGB.Text + s.UnicodeToGB(s.TP_UD) + vbCrLf
        Catch err As Exception
            Me.Text = err.Message
        End Try
        txtPDU.Text = ""
        txtGB.SelectAll()
    End Sub
End Class

⌨️ 快捷键说明

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