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

📄 smsmainfrm.frm

📁 SMS发短信源代码
💻 FRM
📖 第 1 页 / 共 3 页
字号:
      TabIndex        =   2
      Top             =   120
      Width           =   135
   End
   Begin VB.Label Label2 
      BackColor       =   &H00A27E66&
      Height          =   255
      Left            =   7440
      TabIndex        =   1
      Top             =   120
      Width           =   615
   End
   Begin VB.Label Label1 
      BackColor       =   &H00A27E66&
      Caption         =   "Honeybee Developer"
      BeginProperty Font 
         Name            =   "Verdana"
         Size            =   8.25
         Charset         =   0
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      ForeColor       =   &H00FFFFFF&
      Height          =   255
      Left            =   450
      TabIndex        =   0
      Top             =   120
      Width           =   2115
   End
   Begin VB.Line Line4 
      BorderColor     =   &H00FFFFFF&
      X1              =   120
      X2              =   8390
      Y1              =   300
      Y2              =   300
   End
   Begin VB.Line Line3 
      BorderColor     =   &H00FFFFFF&
      X1              =   120
      X2              =   8390
      Y1              =   240
      Y2              =   240
   End
   Begin VB.Line Line2 
      BorderColor     =   &H00FFFFFF&
      X1              =   120
      X2              =   8390
      Y1              =   180
      Y2              =   180
   End
   Begin VB.Line Line1 
      BorderColor     =   &H00FFFFFF&
      X1              =   120
      X2              =   8390
      Y1              =   120
      Y2              =   120
   End
   Begin VB.Shape Shape1 
      BorderStyle     =   0  'Transparent
      FillColor       =   &H00A27E66&
      FillStyle       =   0  'Solid
      Height          =   495
      Left            =   0
      Top             =   0
      Width           =   8655
   End
   Begin VB.Line Line10 
      BorderColor     =   &H00FFFFFF&
      X1              =   120
      X2              =   8390
      Y1              =   6480
      Y2              =   6480
   End
   Begin VB.Line Line9 
      BorderColor     =   &H00FFFFFF&
      X1              =   120
      X2              =   8390
      Y1              =   6540
      Y2              =   6540
   End
   Begin VB.Line Line8 
      BorderColor     =   &H00FFFFFF&
      X1              =   120
      X2              =   8390
      Y1              =   6600
      Y2              =   6600
   End
   Begin VB.Line Line7 
      BorderColor     =   &H00FFFFFF&
      X1              =   120
      X2              =   8390
      Y1              =   6660
      Y2              =   6660
   End
   Begin VB.Label Label11 
      Appearance      =   0  'Flat
      BackColor       =   &H80000005&
      Caption         =   "zhanok@163.net"
      BeginProperty Font 
         Name            =   "Tahoma"
         Size            =   8.25
         Charset         =   0
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      ForeColor       =   &H80000008&
      Height          =   255
      Left            =   6600
      TabIndex        =   32
      Top             =   6060
      Width           =   1695
   End
   Begin VB.Label Label12 
      Appearance      =   0  'Flat
      BackColor       =   &H00FFFFFF&
      Caption         =   "连接..."
      BeginProperty Font 
         Name            =   "Tahoma"
         Size            =   8.25
         Charset         =   0
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      ForeColor       =   &H000000FF&
      Height          =   255
      Left            =   1440
      TabIndex        =   33
      Top             =   6075
      Width           =   2910
   End
   Begin VB.Shape Shape2 
      BorderStyle     =   0  'Transparent
      FillColor       =   &H00A27E66&
      FillStyle       =   0  'Solid
      Height          =   495
      Left            =   0
      Top             =   6360
      Width           =   8775
   End
   Begin VB.Image Image1 
      Height          =   7875
      Left            =   -120
      Picture         =   "SMSmainfrm.frx":030E
      Top             =   360
      Width           =   1335
   End
End
Attribute VB_Name = "SMSmainfrm"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
'================================================================
'================================================================
'***                  SMS Messenger v1.0                      ***
'================================================================
'================================================================
'*** For any Questions or Comments concerning this program    ***
'*** Homepage : http://www.138139.com                         ***
'================================================================
'================================================================
'*** Frame Name  : SMSmainfrm.frm                             ***
'*** Date & Time : 21st October 2002, 04:30(IST)              ***
'================================================================
'================================================================


Private Sub Command1_Click()
   'Command1.Enabled = False
   Ssend = 1
   Call sendsms(Text3.Text, Text2.Text, Text1.Text)

End Sub

Private Sub Command5_Click()
   If SMS.CommPort <> Combo1.Text Then
      If SMS.PortOpen = True Then SMS.PortOpen = False
         SMS.CommPort = Combo1.Text
         SMS.InputLen = 0
         SMS.Settings = Combo2.Text
         SMS.PortOpen = True
   End If
   Frame5.Visible = False
End Sub

Private Sub Command8_Click()
   'Command8.Enabled = False
   Ssend = 2
   Call sendsms(Text3.Text, Text2.Text, Text1.Text)
End Sub

Private Sub Command2_Click()
   Frame5.Visible = True

End Sub

Private Sub Command3_Click()
   Frame6.Visible = True
End Sub

Private Sub Command4_Click()
   Frame6.Visible = False
End Sub


Private Sub Command6_Click()
   Frame5.Visible = False
End Sub



Private Sub Form_Load()
    Dim h As Integer
    SMSgrid.TextMatrix(0, 0) = "Status"
    SMSgrid.TextMatrix(0, 1) = "Destination"
    SMSgrid.TextMatrix(0, 2) = "Message"
    SMSgrid.TextMatrix(0, 3) = "Type"
    SMSgrid.ColWidth(0) = 800
    SMSgrid.ColWidth(1) = 1200
    SMSgrid.ColWidth(2) = 3900
    SMSgrid.ColWidth(3) = 800
    
    Frame6.Visible = False
    Frame5.Visible = False
    addcombo
    GetPrefs
    id = 0
    Text2.Text = "138..."
    
    Label4.Caption = Len(Text1.Text) & "/160"
    Command1.Enabled = False
    Command8.Enabled = False
    SMS.CommPort = Combo1.Text
    SMS.InputLen = 0
    SMS.Settings = Combo2.Text
    SMS.PortOpen = True
    SMS.Output = "AT+CPAS" & vbCrLf
    
    Text4.Text = "【需要的硬件配置】" & vbNewLine
    Text4.Text = Text4.Text & "一台电脑(笔记本或台式机)、一部可以与电脑连接的手机或GSM Modem。" & vbNewLine
    
    Text4.Text = Text4.Text & "【支持的手机】" & vbNewLine
    Text4.Text = Text4.Text & "西门子S3508(i) S3568(i) ..." & vbNewLine
    Text4.Text = Text4.Text & "诺基亚6110 6150 ..." & vbNewLine
    Text4.Text = Text4.Text & "摩托罗拉 (部分机型)" & vbNewLine
    
    Text4.Text = Text4.Text & "手机是否支持电脑连接收发短信,要看手机是否有内置Modem,这可通过了解手机技术说明得知,并且不同的手机使用的端口参数是不同的,本演示程序以S3508i为默认设置,其它机型要根据手机参数要求进行设置,否则,将不能连接。" & vbNewLine
    Text4.Text = Text4.Text & "当向端口发送“AT”命令返回“OK”,则说明已正确连接,否则,应当修改端口参数重新测试。需要修改的是端口号和波特率,数据位、停止位、奇偶校验位一般不要修改,测试连接情况也可以使用超级终端程序。" & vbNewLine
    Text4.Text = Text4.Text & "如果参数设置没问题,仍不能正确连接,请检查电脑端口、手机或更换数据连接线。数据连接线的质量,对数据的正确传输有很大的关系,一般用户会忽视这一点。" & vbNewLine
    
    Text4.Text = Text4.Text & "【选择西门子手机的理由】" & vbNewLine
    Text4.Text = Text4.Text & "1-使用电脑连接手机收发短信的最基本的前提条件是,手机内置了与电脑通讯的Modem。大多数西门子手机都具备这个功能,而且统一接口比较好配数据线,手机价位从几百元到上千元,品种比较全,易于买到满足需要的手机。" & vbNewLine
    Text4.Text = Text4.Text & "2-使用电脑连接手机收发短信的另个条件,看似并不重要而实际上最容易卡壳的就是,手机与电脑连接的数据线。西门子手机的数据线,统一接口,在市场上比较好买,原装数据线在西门子的服务部都能买到(这很重要,因为非原装数据线的质量一般不过关,往往图便宜,而不能可靠传输数据)。" & vbNewLine
    Text4.Text = Text4.Text & "3-其它手机,同时具备“内置Modem、价位低、数据线”条件的不多。" & vbNewLine
    
    Text4.Text = Text4.Text & "【使用说明】" & vbNewLine
    Text4.Text = Text4.Text & "发送短信时,SMSC(短信服务中心)的号码应填写您当地移动公司指定的号码,否则不会发送成功。" & vbNewLine
    Text4.Text = Text4.Text & "只能手动一次发送一条短信给一个手机。" & vbNewLine
    Text4.Text = Text4.Text & "通过编程可以实现自动接收并转发收到的短信,可以实现批量自动发送。发送一条短信一般需要3-5秒的时间,具体与短信长度和手机数据处理速度有关。" & vbNewLine

End Sub

Private Sub Label3_Click()
   SMS.PortOpen = False
   SetPrefs
   Unload Me
End Sub

Private Sub Option1_Click()
    Label4.Caption = Len(Text1.Text) & "/160"
    Text1.MaxLength = 160
End Sub
Private Sub Option2_Click()
    Label4.Caption = Len(Text1.Text) & "/160"
    Text1.MaxLength = 160
End Sub
Private Sub Option3_Click()
    Label4.Caption = Len(Text1.Text) & "/70"
    Text1.MaxLength = 70
End Sub

Private Sub Picture1_Click()
   WindowState = 1
End Sub

Private Sub Text1_Change()
    If Option3.Value <> True Then
       B = 1
       For B = 1 To Len(Text1.Text)
           If Mid(Text1.Text, B, 1) = "|" Then D = "*"
       Next B
       If D = "*" Then
          Option3.Value = True
          Label4.Caption = Len(Text1.Text) & "/70"
          Text1.MaxLength = 70
       Else
          Label4.Caption = Len(Text1.Text) & "/160"
          Text1.MaxLength = 160
       End If
    Else
       Label4.Caption = Len(Text1.Text) & "/70"
       Text1.MaxLength = 70
    End If
End Sub

Private Sub Timer1_Timer()

    SMS.Output = "AT+CPAS" & vbCrLf
    presp = SMS.Input
    Label12.Caption = presp
    stat = findstr(presp, "+CPAS: 0")
    connected (stat)
    
End Sub

Private Sub connected(id)
   Select Case id
   Case 1: Label12.Caption = Label12.Caption & "-已经连接"
           Command1.Enabled = True
           Command8.Enabled = True
           Timer1.Enabled = False
   Case Is <> 1: Label12.Caption = Label12.Caption & "-连接失败"
           Command1.Enabled = False
           Command8.Enabled = False
   End Select
End Sub

⌨️ 快捷键说明

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