📄 smsmainfrm.frm
字号:
'cTxt.Text = d1
If d1 = 0 Then
MsgBox "ok"
Else
MsgBox "error"
End If
End Sub
Private Sub Command12_Click() '移动发送确定 text3内容为移动短信中心号码
'Command1.Enabled = False
'电话号码去掉"+",或者加头"68"
Dim SMSC, Phno, smsg
If Text6.Text = "" Then
MsgBox " 信息不能为空", vbOKOnly, "惠济通讯_lql2005"
Exit Sub
End If
'去掉"+"
If Mid(Text3.Text, 1, 1) = "+" Then Text3.Text = Mid(Text3.Text, 2, 13)
If Mid(Text5.Text, 1, 1) = "+" Then Text5.Text = Mid(Text5.Text, 2, 13)
'加上 "86"
If Len(Text3.Text) = 11 Then Text3.Text = "86" + Text3.Text
'If Mid(Text5.Text, 1, 2) <> "86" Then Text5.Text = "86" + Text5.Text
'If Mid(mdTxt.Text, 1, 2) <> "86" Then Text5.Text = "86" + Text5.Text
'去掉"00"
If Len(Text3.Text) = 15 Then Text3.Text = Mid(Text3.Text, 3, 13)
If Len(Text5.Text) = 15 Then Text5.Text = Mid(Text5.Text, 3, 13)
'End If
'使用移动01861 和连连"03536" 作目的代码 ( 0,移动. 1,连连.2,联动.3,联通 )
Dim ret As Integer
ret = xtCmb.ListIndex
Select Case ret
Case 0
'smsg = Text7.Text & Chr(32) & Text6.Text
' Label9.Caption = "移动手机缴费系统"
' Label4.Caption = "移动系统专用"
Case 1
' smsg = Text7.Text & Chr(32) & Text6.Text
'Label9.Caption = "移动手机缴费系统"
'Label4.Caption = "连连系统专用"
Case 2
' smsg = Text6.Text
' Label9.Caption = "移动手机缴费系统"
' Label4.Caption = "联动系统专用"
Case 3
smsg = Text6.Text
'Label9.Caption = "联通手机缴费系统"
' Label4.Caption = "联通系统专用"
End Select
' If xtCmb.ListIndex = 0 Then smsg = Text7.Text & Chr(32) & Text6.Text 'text7 账户和密码 text6 交费号码,金额
' If xtCmb.ListIndex = 1 Then smsg = Text7.Text & Chr(32) & Text6.Text
'联通(8129), 连连(0353911)
'If xtCmb.ListIndex = 2 Then smsg = Text6.Text
' If xtCmb.ListIndex = 3 Then smsg = Text6.Text
' End If 'end if 不能放此处,否则sms内容为空
'发送信息
Ssend = 1
' MsgBox Text5.Text, , lql
'Call sendsms(Text3.Text, Text5.Text, Text6.Text) 'old,error
'text3 中心号码,text5 目的号码 ,smsg 信息内容
SMSC = Text3.Text
Phno = Text5.Text
' MsgBox SMSC, , "00000000"
' MsgBox Phno, , "111111"
Call sendsms(SMSC, Phno, smsg)
'存储信息 格式:充值电话 金额 日期 时间
File_Ycread
End Sub
Private Sub File_Ycread() '存储移动信息 格式:充值电话 金额 日期 时间
Dim msg, dat1, Dat2
Dim Dat
msg = Text6.Text
dat1 = Date
Dat2 = Date + Time
Dat = msg ' + Date
'Open "666msg.dat" For Output As #1
If Text6.Text = "" Then
'Text1.Enabled = False
MsgBox " 信息不能为空", vbOKOnly, "惠济通讯_lql2005 "
Else
Open "ydmsg.txt" For Append As #1
'Print #1, "; ————————————————————————————————————"
'Print #1, "; 惠济通讯 20"; Dat1; " 联通便利行充值记录 "
'Print #1, "; ————————————————————————————————————"
Print #1, ""; msg; " "; Dat2; "" ' Msg; """
Close #1
Text9.Text = Text6.Text
Text6.Text = ""
'Command2.SetFocus
Text6.SetFocus
End If
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
SetPrefs
Frame5.Visible = False
MsgBox "设定后,请重新启动程序!", , "提示"
Unload SMSmainfrm
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()
MsgBox "您使用的是联通缴费版,如需移动短信缴费版,请联系13592682815", , "提示信息"
Frame5.Visible = True
End Sub
Private Sub Command3_Click()
MsgBox "您使用的是联通缴费版,如需移动短信缴费版,请联系13592682815", , "提示信息"
Frame6.Visible = True
Label8.Caption = "手机短信缴费程序,简化手机操作。 惠济通讯制作 TEL:13592682815"
Label16.Caption = " LQL CopyRight 2004"
End Sub
Private Sub Command4_Click()
Frame6.Visible = False
End Sub
Private Sub Command6_Click()
Frame5.Visible = False
End Sub
Private Sub Command9_Click()
'ReadMsg
' Ssend = 3
'FindMsg
SMSReceive
strReceive = SMS.Input
TimeDelay (1000)
Open "msg.txt" For Output As #1
Print #1, strReceive
Close #1
End Sub
Private Sub Form_Load()
Dim h As Integer
SMSGrid.TextMatrix(0, 0) = "信息状态"
SMSGrid.TextMatrix(0, 1) = "电话号码"
SMSGrid.TextMatrix(0, 2) = "信息内容"
SMSGrid.TextMatrix(0, 3) = "信息类型"
SMSGrid.ColWidth(0) = 500
SMSGrid.ColWidth(1) = 1200
SMSGrid.ColWidth(2) = 4000
SMSGrid.ColWidth(3) = 1000
Frame6.Visible = False
Frame5.Visible = False
addcombo
GetPrefs
id = 0
Dim ret1 As Integer
ret1 = xtCmb.ListIndex
Select Case ret1
Case 0
'smsg = Text7.Text & Chr(32) & Text6.Text
Label19.Caption = "移动手机缴费系统"
Label4.Caption = "移动系统专用"
Case 1
' smsg = Text7.Text & Chr(32) & Text6.Text
Label19.Caption = "移动手机缴费系统"
Label4.Caption = "连连系统专用"
Case 2
'smsg = Text6.Text
Label19.Caption = "移动手机缴费系统"
Label4.Caption = "联动系统专用"
Case 3
'smsg = Text6.Text
Label19.Caption = "联通手机缴费系统"
Label4.Caption = "联通系统专用"
End Select
'联通
'Text2.Text = "8129"
'Text1.Text = ""
'移动
'Text1.Text = ""
'Text5.Text = "01861"
'Text6.Text = ""
'连动
'Text1.Text = ""
'Text5.Text = "0353911"
'Text6.Text = ""
'连连
'20060513目的号码改成可有用户自己设置
Text1.Text = ""
'目的号码自动设置
Text5.Text = mdTxt.Text
Text6.Text = ""
' Label4.Caption = Len(Text1.Text) & "/160"
'Command1.Enabled = False
'Command8.Enabled = False
'Command12.Enabled = False
SMS.CommPort = Combo1.Text
'Text7.Text = Text8.Text
SMS.InputLen = 0
SMS.Settings = Combo2.Text
SMS.PortOpen = True
SMS.Output = "AT" & Chr$(13) & Chr(10)
'SMS.Output = "AT+CPAS" & vbCrLf
' SMS.Output = "AT+CNMI= 2,2,0,0" & vbCr & Chr(10)
TimeDelay (100)
'MsgBox SMS.Input
mywidth = Me.Width
myheight = Me.Height
' 联通版专用设置
Text8.Text = "用于移动缴费系统"
Text8.Enabled = False
xtCmb.ListIndex = 3
xtCmb.Enabled = False
dat_Lab.Caption = Date
xt_Time.Interval = 1000
Lab_time.Caption = Time
End Sub
Private Sub helpCnd_Click()
Dim lql
lql = Shell("C:\WINDOWS\NOTEPAD.EXE help.txt", 1)
End Sub
Private Sub Label3_Click() '删除信息
SMS.PortOpen = False
SetPrefs
Unload Me
If Dir("c:\msg.txt") = "msg.txt" Then
Kill "c:\msg.txt"
End If
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 recbut_Click()
TimeDelay (50)
Pmsg = Text2.Text
'MsgBox Plql
' Pmsg = "+CMT: ,28 0891683108301705F00405A11068F10008502103517312230C8F93516553C265704E0D7B26"
'Pmsg = "+CMT: ,26 0891683108301705F0240D91683183838588F200005021036133452306B1582C168B01"
'+CMT: ,24
'0891683108301705F0240D91683183838588F20000601030128071230431D98C06
'+CMT: ,24
'0891683108301705F0240D91683183838588F20000601030128095230432994C06
'0891683108301705F0040D91683195622818F50000601013004555230EB1582C168BC562B1582C168B01
'+CMT: ,35 0891683108301705F0040D91683195622818F50000601013008505231131D98C56B3DD7039582C168BC56231
Sms_Msg (Pmsg)
End Sub
Private Sub rec_Click()
recbut_Click
End Sub
Private Sub SMS_OnComm()
Dim rMsg, rdat, dat0, dat1
Dim dLlen, DatL
Select Case SMS.CommEvent
Case comEvCD ' CD 线状态变化。
Case comEvCTS ' CTS 线状态变化。
Case comEvDSR ' DSR 线状态变化。
Case comEvRing ' Ring Indicator 变化。
Case comEvReceive ' 收到 RThreshold # ofchars.
TimeDelay (50)
rMsg = SMS.Input
' MsgBox rMsg
rdat = InStr(rMsg, "+CMT:")
'MsgBox rdat, , "lql"
If rdat > 1 Then
DatL = Len(rMsg)
'dlen = Mid(rMsg, rdat + 8, 2)
'MsgBox dlen, , "dlen"
dat0 = Mid(rMsg, rdat + 9, DatL - (rdat + 9))
'MsgBox dat0, , "dat0"
'Text1.Text = dat0
Text2.Text = rMsg
'Plql = dat0
Else
Exit Sub
End If
recbut_Click
Case comEvSend ' 传输缓冲区有 Sthreshold 个字符
Case comEvEOF ' 输入数据流中发现 EOF 字符
End Select
End Sub
Private Sub Timer1_Timer()
'SMS.PortOpen = True
SMS.Output = "AT" & Chr$(13) 'vbCrLf
presp = SMS.Input
stat = findstr(presp, "OK")
connected (stat)
End Sub
Private Sub connected(id)
Select Case id
Case 1: Label12.Caption = "联机成功......"
'Command1.Enabled = True
'Command8.Enabled = True
Command9.Enabled = True
Command12.Enabled = True
Case Is <> 1: Label12.Caption = "正在联机......."
' Command1.Enabled = False
'Command8.Enabled = False
Command9.Enabled = False
'Command12.Enabled = False
End Select
End Sub
Private Sub xt_Time_Timer()
Lab_time.Caption = Time
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -