📄 form1.frm
字号:
VERSION 5.00
Object = "{831FDD16-0C5C-11D2-A9FC-0000F8754DA1}#2.0#0"; "MSCOMCTL.OCX"
Object = "{19B73C7C-C76C-11D2-849E-840A94D4800A}#1.2#0"; "FTP.OCX"
Object = "{79B38E02-1F2D-4A69-9ACB-EEB49C92A1BF}#2.0#0"; "HTAGENT.OCX"
Begin VB.Form Form1
Caption = "B-DZJC01数据"
ClientHeight = 8220
ClientLeft = 60
ClientTop = 345
ClientWidth = 13185
LinkTopic = "Form1"
MaxButton = 0 'False
ScaleHeight = 8220
ScaleWidth = 13185
StartUpPosition = 3 '窗口缺省
WindowState = 1 'Minimized
Begin VB.CommandButton Command5
Caption = "Command5"
Height = 255
Left = 7920
TabIndex = 20
Top = 6840
Visible = 0 'False
Width = 855
End
Begin VB.Frame Frame3
Height = 615
Left = 3000
TabIndex = 17
Top = 6930
Width = 2415
Begin VB.OptionButton Option2
Caption = "同步传输"
Height = 375
Left = 1200
TabIndex = 19
Top = 180
Width = 1155
End
Begin VB.OptionButton Option1
Caption = "异步传输"
Height = 255
Left = 60
TabIndex = 18
Top = 240
Value = -1 'True
Width = 1095
End
End
Begin VB.CheckBox Check1
Caption = "0.1小时执行一次"
Height = 345
Left = 30
TabIndex = 13
Top = 7110
Value = 1 'Checked
Width = 1845
End
Begin VB.Frame Frame2
Height = 675
Left = 30
TabIndex = 10
Top = 7500
Width = 5355
Begin MSComctlLib.ProgressBar ProgressBar3
Height = 255
Left = 90
TabIndex = 15
Top = 360
Width = 2955
_ExtentX = 5212
_ExtentY = 450
_Version = 393216
BorderStyle = 1
Appearance = 0
Scrolling = 1
End
Begin VB.CommandButton Command1
Caption = "上 传"
Height = 435
Left = 3090
TabIndex = 12
Top = 180
Width = 1095
End
Begin VB.CommandButton Command2
Caption = "写入日志"
Height = 435
Left = 4230
TabIndex = 11
Top = 180
Width = 1005
End
Begin VB.Label Label4
AutoSize = -1 'True
Caption = "0%"
ForeColor = &H000000FF&
Height = 180
Left = 1230
TabIndex = 16
Top = 150
Width = 180
End
End
Begin VB.Timer Timer1
Interval = 1000
Left = 4110
Top = 8550
End
Begin VB.ListBox List2
BackColor = &H00000000&
ForeColor = &H0000FF00&
Height = 6720
Left = 5460
TabIndex = 9
Top = 30
Width = 7725
End
Begin VB.Frame Frame1
Height = 1125
Left = 5520
TabIndex = 2
Top = 7050
Width = 7605
Begin VB.CommandButton Command4
Caption = "下 载"
Height = 405
Left = 6210
TabIndex = 5
Top = 210
Width = 1335
End
Begin VB.CommandButton Command3
Caption = "写入日志"
Enabled = 0 'False
Height = 405
Left = 6210
TabIndex = 3
Top = 630
Width = 1335
End
Begin MSComctlLib.ProgressBar ProgressBar1
Height = 405
Left = 60
TabIndex = 4
Top = 300
Width = 3645
_ExtentX = 6429
_ExtentY = 714
_Version = 393216
BorderStyle = 1
Appearance = 0
Scrolling = 1
End
Begin MSComctlLib.ProgressBar ProgressBar2
Height = 405
Left = 3810
TabIndex = 6
Top = 300
Width = 2295
_ExtentX = 4048
_ExtentY = 714
_Version = 393216
BorderStyle = 1
Appearance = 0
Scrolling = 1
End
Begin VB.Label Label3
AutoSize = -1 'True
Caption = "0%"
BeginProperty Font
Name = "宋体"
Size = 12
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H000000FF&
Height = 240
Left = 1650
TabIndex = 8
Top = 780
Width = 270
End
Begin VB.Label Label2
AutoSize = -1 'True
Caption = "0%"
BeginProperty Font
Name = "宋体"
Size = 12
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H000000FF&
Height = 240
Left = 4830
TabIndex = 7
Top = 810
Width = 270
End
End
Begin VB.ListBox List1
BackColor = &H00000000&
ForeColor = &H0000FF00&
Height = 6900
Left = 0
TabIndex = 1
Top = 30
Width = 5385
End
Begin HTAGENTLib.HTAgent HTAgent1
Height = 795
Left = 4470
TabIndex = 0
Top = 8580
Visible = 0 'False
Width = 825
_Version = 65536
_ExtentX = 1455
_ExtentY = 1402
_StockProps = 0
End
Begin VB.Label Label1
AutoSize = -1 'True
Caption = "00:00:00"
Height = 180
Left = 1920
TabIndex = 14
Top = 7200
Width = 720
End
Begin DevPowerFTP.FTP FTP1
Left = 5730
Top = 8490
_ExtentX = 847
_ExtentY = 847
AlwaysIncludeDirs= 0 'False
WildCard = ""
End
End
Attribute VB_Name = "Form1"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Dim Cs(1 To 3) As String
Dim Cn As New ADODB.Connection
Dim RS As New ADODB.Recordset
Dim fN(1 To 4) As String
Dim k As Long, kk As Long
Dim ccn As New ADODB.Connection
'Dim RS As New ADODB.Recordset
Dim Sz(1 To 255, 1 To 5) As String, LKs As Integer
Dim WSum As Long
Dim TCS As String
Dim Cgs As Long
Dim Sbs As Long
Private Sub Check1_Click()
If Check1.Value = 1 Then
k = 25 * 60
Timer1.Enabled = True
Else
Timer1.Enabled = False
End If
End Sub
Private Sub Command1_Click()
Cgs = 0
Sbs = 0
Command1.Enabled = False
List1.Clear
CsSj
Command2_Click
Command1.Enabled = True
End Sub
Private Sub Command2_Click()
Dim i As Long
Command2.Enabled = False
Open App.Path & "\log\sc" & Format(Date, "yyyymmdd") & Format(Time, "hhnnss") & ".log" For Output As #1
For i = 0 To List1.ListCount
Print #1, List1.List(i)
Next
Close #1
Command2.Enabled = True
End Sub
Private Sub Command3_Click()
Dim i As Long
Command3.Enabled = False
Open App.Path & "\log\xz" & Format(Date, "yyyymmdd") & Format(Time, "hhnnss") & ".log" For Output As #1
For i = 0 To List2.ListCount
Print #1, List2.List(i)
Next
Close #1
Command3.Enabled = True
End Sub
Private Sub Command4_Click()
Xh
Command3_Click
End Sub
Private Sub Command5_Click()
SjSc
End Sub
Private Sub Form_Load()
Dim Ks As New ADODB.Recordset
Dim i As Integer
i = 1
Me.Top = (Screen.Height - Me.Height) / 2 - 1000
Me.Left = (Screen.Width - Me.Width) / 2
Me.Show
Ks.CursorLocation = adUseClient
ccn.Open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & App.Path & "\db\id.mdb;Persist Security Info=False"
Ks.Open "select * from mc", ccn, 1, 3
Do While Not Ks.EOF
Sz(i, 1) = Ks(0)
Sz(i, 2) = Ks(1)
Sz(i, 3) = Ks(2)
Sz(i, 4) = Ks(3)
Sz(i, 5) = Ks(4)
i = i + 1
Ks.MoveNext
Loop
LKs = Ks.RecordCount
Ks.Close
Cn.CursorLocation = adUseClient
Cn.Open "Driver={Microsoft Visual FoxPro Driver};SourceType=DBF;SourceDB=" & App.Path & "\PICDATA;" & "Exclusive=NO"
k = 25 * 60
TCS = Format(Date, "yyyy-mm-dd") & " " & Format(Time, "hh:nn:ss")
Cgs = 0
Sbs = 0
End Sub
Private Sub Form_Unload(Cancel As Integer)
HTAgent1.CloseTrans
ccn.Close
Cn.Close
End Sub
Public Sub CsSj()
On Error Resume Next
Dim i As Integer
Dim Cd As String
Dim Fx As String
List1.Clear
For i = 1 To LKs
Dim FL As String
List1.AddItem "启动传输时间 " & Date & " " & Time
HTAgent1.CloseTrans
If Not HTAgent1.InitTrans(Sz(i, 3), Sz(i, 4)) Then
List1.AddItem "连接 失败"
Exit Sub
Else
List1.AddItem "连接成功 "
End If
If HTAgent1.QuerySyncTime() = "" Then
List1.AddItem "取服务器时间失败 "
Else
List1.AddItem "取服务器时间成功 " & HTAgent1.QuerySyncTime()
End If
Cn.Close
Cn.Open
FL = Dir(App.Path & "\PICDATA\*.dbf")
Do While FL <> ""
RS.CursorLocation = adUseClient
RS.Open "select * from " & FL & " where not sended and REDTIME<>'00:00:00' and date<='" & Format(Date, "yyyy.mm.dd") & "'", Cn, 1, 3
List1.AddItem "**************************************"
List1.AddItem "传输" & RS.RecordCount & " 条记录"
List1.AddItem "传输" & Sz(i, 1)
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -