?? frmmain.frm
字號:
VERSION 5.00
Object = "{831FDD16-0C5C-11D2-A9FC-0000F8754DA1}#2.0#0"; "mscomctl.ocx"
Object = "{648A5603-2C6E-101B-82B6-000000000014}#1.1#0"; "mscomm32.ocx"
Begin VB.Form frmMain
BorderStyle = 1 'Fixed Single
Caption = "手機短信發送服務程序"
ClientHeight = 4725
ClientLeft = 45
ClientTop = 615
ClientWidth = 10515
Icon = "frmMain.frx":0000
LinkTopic = "Form1"
MaxButton = 0 'False
ScaleHeight = 4725
ScaleWidth = 10515
StartUpPosition = 1 '所有者中心
Begin VB.CommandButton bntSTOP
Caption = "中斷"
Height = 345
Left = 9090
TabIndex = 12
Top = 780
Width = 1305
End
Begin VB.CommandButton bntDelete
Appearance = 0 'Flat
Height = 300
Left = 8310
Picture = "frmMain.frx":0442
Style = 1 'Graphical
TabIndex = 11
Top = 1110
Width = 300
End
Begin VB.CommandButton bntNew
Appearance = 0 'Flat
Height = 300
Left = 8310
Picture = "frmMain.frx":049B
Style = 1 'Graphical
TabIndex = 10
Top = 390
Width = 300
End
Begin VB.CommandButton bntEdit
Appearance = 0 'Flat
Height = 300
Left = 8310
Picture = "frmMain.frx":0501
Style = 1 'Graphical
TabIndex = 9
Top = 750
Width = 300
End
Begin VB.CheckBox Check1
Caption = "優先采用服務商一致原則"
Height = 225
Left = 5850
TabIndex = 7
Top = 3990
Width = 2385
End
Begin MSComctlLib.ListView ListView
Height = 3435
Left = 90
TabIndex = 6
Top = 390
Width = 8115
_ExtentX = 14314
_ExtentY = 6059
View = 3
LabelEdit = 1
LabelWrap = -1 'True
HideSelection = 0 'False
Checkboxes = -1 'True
FullRowSelect = -1 'True
_Version = 393217
ForeColor = -2147483640
BackColor = -2147483643
BorderStyle = 1
Appearance = 1
NumItems = 6
BeginProperty ColumnHeader(1) {BDD1F052-858B-11D1-B16A-00C0F0283628}
Key = "Port"
Text = "端口"
Object.Width = 1411
EndProperty
BeginProperty ColumnHeader(2) {BDD1F052-858B-11D1-B16A-00C0F0283628}
SubItemIndex = 1
Key = "ServiceTelphone"
Text = "服務中心號碼"
Object.Width = 3528
EndProperty
BeginProperty ColumnHeader(3) {BDD1F052-858B-11D1-B16A-00C0F0283628}
SubItemIndex = 2
Key = "Status"
Text = "當前狀態"
Object.Width = 3528
EndProperty
BeginProperty ColumnHeader(4) {BDD1F052-858B-11D1-B16A-00C0F0283628}
SubItemIndex = 3
Text = "提供商"
Object.Width = 1764
EndProperty
BeginProperty ColumnHeader(5) {BDD1F052-858B-11D1-B16A-00C0F0283628}
SubItemIndex = 4
Text = "打頭號碼"
Object.Width = 5292
EndProperty
BeginProperty ColumnHeader(6) {BDD1F052-858B-11D1-B16A-00C0F0283628}
SubItemIndex = 5
Object.Width = 2540
EndProperty
End
Begin VB.CheckBox chkSendAttend
Caption = "允許發送與考勤相關的短信"
Height = 255
Left = 2970
TabIndex = 5
Top = 3990
Value = 1 'Checked
Width = 2595
End
Begin VB.CheckBox chkSendWebSM
Caption = "允許發送由網站提交的短信"
Height = 285
Left = 60
TabIndex = 4
Top = 3990
Value = 1 'Checked
Width = 2565
End
Begin MSComctlLib.StatusBar StatusBar
Align = 2 'Align Bottom
Height = 345
Left = 0
TabIndex = 3
Top = 4380
Width = 10515
_ExtentX = 18547
_ExtentY = 609
_Version = 393216
BeginProperty Panels {8E3867A5-8586-11D1-B16A-00C0F0283628}
NumPanels = 3
BeginProperty Panel1 {8E3867AB-8586-11D1-B16A-00C0F0283628}
Object.Width = 3528
MinWidth = 3528
Text = "網絡短信:"
TextSave = "網絡短信:"
EndProperty
BeginProperty Panel2 {8E3867AB-8586-11D1-B16A-00C0F0283628}
Object.Width = 3528
MinWidth = 3528
Text = "考勤短信:"
TextSave = "考勤短信:"
EndProperty
BeginProperty Panel3 {8E3867AB-8586-11D1-B16A-00C0F0283628}
Object.Width = 88194
MinWidth = 88194
Text = "狀態:"
TextSave = "狀態:"
EndProperty
EndProperty
End
Begin VB.CommandButton bntSend
Caption = "啟動"
Height = 345
Left = 9090
TabIndex = 2
Top = 330
Width = 1305
End
Begin VB.Timer Timer
Left = 9120
Top = 3780
End
Begin VB.CommandButton bntCancel
Caption = "退出"
Height = 345
Left = 9090
TabIndex = 1
Top = 1230
Width = 1305
End
Begin VB.Frame frmLine
Height = 3615
Left = 8790
TabIndex = 0
Top = 180
Width = 30
End
Begin MSCommLib.MSComm MSComm
Index = 1
Left = 8220
Top = 1680
_ExtentX = 1005
_ExtentY = 1005
_Version = 393216
DTREnable = -1 'True
End
Begin MSCommLib.MSComm MSComm
Index = 2
Left = 9390
Top = 1650
_ExtentX = 1005
_ExtentY = 1005
_Version = 393216
DTREnable = -1 'True
End
Begin MSCommLib.MSComm MSComm
Index = 3
Left = 9450
Top = 2310
_ExtentX = 1005
_ExtentY = 1005
_Version = 393216
DTREnable = -1 'True
End
Begin MSCommLib.MSComm MSComm
Index = 4
Left = 8820
Top = 2310
_ExtentX = 1005
_ExtentY = 1005
_Version = 393216
DTREnable = -1 'True
End
Begin MSCommLib.MSComm MSComm
Index = 5
Left = 8220
Top = 2310
_ExtentX = 1005
_ExtentY = 1005
_Version = 393216
DTREnable = -1 'True
End
Begin MSCommLib.MSComm MSComm
Index = 6
Left = 8220
Top = 2970
_ExtentX = 1005
_ExtentY = 1005
_Version = 393216
DTREnable = -1 'True
End
Begin MSCommLib.MSComm MSComm
Index = 7
Left = 8850
Top = 2970
_ExtentX = 1005
_ExtentY = 1005
_Version = 393216
DTREnable = -1 'True
End
Begin MSCommLib.MSComm MSComm
Index = 8
Left = 9480
Top = 2970
_ExtentX = 1005
_ExtentY = 1005
_Version = 393216
DTREnable = -1 'True
End
Begin VB.Label Label1
Caption = "TC35短信發送設備列表(&L)"
Height = 195
Left = 90
TabIndex = 8
Top = 120
Width = 2265
End
Begin VB.Menu menuTray
Caption = "系統(&S)"
Begin VB.Menu menuTray_Open
Caption = "顯示窗口(&S)"
Enabled = 0 'False
End
Begin VB.Menu menuTray_Hide
Caption = "隱含窗口(&H)"
End
Begin VB.Menu menuSplit
Caption = "-"
End
Begin VB.Menu menuExit
Caption = "退出系統(&E)"
End
End
Begin VB.Menu menuTC35
Caption = "終端(&T)"
Begin VB.Menu menuTC35_Add
Caption = "添加(&A)..."
End
Begin VB.Menu menuTC35_Edit
Caption = "修改(&E)..."
End
Begin VB.Menu split00
Caption = "-"
End
Begin VB.Menu menuTC35_Delete
Caption = "刪除(&R)"
End
End
Begin VB.Menu menuHelp
Caption = "幫助(&H)"
Begin VB.Menu menuHelp_About
Caption = "關于(&A)"
End
End
End
Attribute VB_Name = "frmMain"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit
Const isDebug = False
Dim OkTC35Number As Integer
Dim LastStatus As Integer
Dim bExit As Boolean
Dim bResult As Long
Dim bInit As Boolean
Dim SetTC35(8) As TC35
Dim WithEvents TC35S1 As TC35
Attribute TC35S1.VB_VarHelpID = -1
Dim WithEvents TC35S2 As TC35
Attribute TC35S2.VB_VarHelpID = -1
Dim WithEvents TC35S3 As TC35
Attribute TC35S3.VB_VarHelpID = -1
Dim WithEvents TC35S4 As TC35
Attribute TC35S4.VB_VarHelpID = -1
Dim WithEvents TC35S5 As TC35
Attribute TC35S5.VB_VarHelpID = -1
Dim WithEvents TC35S6 As TC35
Attribute TC35S6.VB_VarHelpID = -1
Dim WithEvents TC35S7 As TC35
Attribute TC35S7.VB_VarHelpID = -1
Dim WithEvents TC35S8 As TC35
Attribute TC35S8.VB_VarHelpID = -1
Private Sub TC35SChangeStatus(ByVal Index As Integer, ByVal Status As EventStatus)
Dim ss As String
With SetTC35(Index)
Select Case Status '取得當前的發送情況狀態
Case STATUS_UNKNOWS '未知,表示未啟動異步發送SM
'Call SetTC35(Index).AsynSend
ss = "等待處理"
Case STATUS_OK '發送成功
OpenCN
If .Para3 = "SysSM" Then
cn.Execute "Update Info_AttendItem set dtSend=getdate(),isSendOK=1,ToMobile='" & .Telphone & "',nTry=nTry+1,ToUser=" & toSQL(.Para2) & " WHERE AttendItemID=" & .Para1
Else
cn.Execute "Update Info_SMItem set dtSend=getdate(),isSendOK=1,nTry=nTry+1 WHERE SMItemID=" & .Para1
cn.Execute "Update Info_SM set nSended=nSended+1 WHERE SMID=" & .Para2
End If
CloseCN
ss = "發送成功"
Case STATUS_ERROR
If .Para3 = "SysSM" Then '系統SM
cn.Execute "Update Info_AttendItem set dtSend=getdate(),isSendOk=0,ToMobile='" & .Telphone & "',nTry=nTry+1,ToUser=" & toSQL(.Para2) & " WHERE AttendItemID=" & .Para1
Else 'WEBSM
cn.Execute "Update Info_SMItem set dtSend=getdate(),isSendOK=0,nTry=nTry+1 WHERE SMItemID=" & .Para1
End If
ss = "發送出錯"
Case STATUS_OUTTIME
If .Para3 = "SysSM" Then '系統SM
cn.Execute "Update Info_AttendItem set dtSend=getdate(),isSendOk=0,ToMobile='" & .Telphone & "',nTry=nTry+1,ToUser=" & toSQL(.Para2) & " WHERE AttendItemID=" & .Para1
Else 'WEBSM
cn.Execute "Update Info_SMItem set dtSend=getdate(),isSendOK=0,nTry=nTry+1 WHERE SMItemID=" & .Para1
End If
ss = "發送超時"
Case STATUS_SENDING '其它狀態,繼續進行
ss = "正在發送..."
Case STATUS_GETTING
ss = "正在接收..."
Case STATUS_SENDED
ss = "命令發完"
End Select
ListView.ListItems(.Key).SubItems(2) = ss
End With
End Sub
Private Sub Command1_Click()
End Sub
Private Sub bntSTOP_Click()
If ShowYesNo("您想中斷當前的服務?") = True Then
bExit = True
Timer.Interval = 0
SetSendStatus True
End If
End Sub
Private Sub TC35S1_ChangeStatus(ByVal Status As EventStatus)
TC35SChangeStatus 1, Status
End Sub
Private Sub TC35S2_ChangeStatus(ByVal Status As EventStatus)
TC35SChangeStatus 2, Status
End Sub
Private Sub TC35S3_ChangeStatus(ByVal Status As EventStatus)
TC35SChangeStatus 3, Status
End Sub
Private Sub TC35S4_ChangeStatus(ByVal Status As EventStatus)
TC35SChangeStatus 4, Status
End Sub
Private Sub TC35S5_ChangeStatus(ByVal Status As EventStatus)
TC35SChangeStatus 5, Status
End Sub
Private Sub TC35S6_ChangeStatus(ByVal Status As EventStatus)
TC35SChangeStatus 6, Status
End Sub
Private Sub TC35S7_ChangeStatus(ByVal Status As EventStatus)
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -