📄 frmtl_restores.frm
字号:
VERSION 5.00
Object = "{831FDD16-0C5C-11D2-A9FC-0000F8754DA1}#2.0#0"; "MSCOMCTL.OCX"
Object = "{BDC217C8-ED16-11CD-956C-0000C04E4C0A}#1.1#0"; "tabctl32.ocx"
Object = "{F9043C88-F6F2-101A-A3C9-08002B2F49FB}#1.2#0"; "Comdlg32.ocx"
Begin VB.Form frmTL_RestoreS
BorderStyle = 5 'Sizable ToolWindow
Caption = "恢复数据"
ClientHeight = 6165
ClientLeft = 60
ClientTop = 300
ClientWidth = 6645
LinkTopic = "Form1"
LockControls = -1 'True
MaxButton = 0 'False
MinButton = 0 'False
ScaleHeight = 6165
ScaleWidth = 6645
ShowInTaskbar = 0 'False
StartUpPosition = 2 '屏幕中心
Begin TabDlg.SSTab sTb
Height = 6135
Left = 0
TabIndex = 0
Top = 0
Width = 7215
_ExtentX = 12726
_ExtentY = 10821
_Version = 393216
TabOrientation = 3
Style = 1
TabHeight = 520
WordWrap = 0 'False
TabCaption(0) = "Tab 0"
TabPicture(0) = "frmTL_RestoreS.frx":0000
Tab(0).ControlEnabled= -1 'True
Tab(0).Control(0)= "lblMemo"
Tab(0).Control(0).Enabled= 0 'False
Tab(0).Control(1)= "dLg"
Tab(0).Control(1).Enabled= 0 'False
Tab(0).Control(2)= "Picture2"
Tab(0).Control(2).Enabled= 0 'False
Tab(0).Control(3)= "Frame2"
Tab(0).Control(3).Enabled= 0 'False
Tab(0).Control(4)= "Frame1"
Tab(0).Control(4).Enabled= 0 'False
Tab(0).Control(5)= "cmdCancel1"
Tab(0).Control(5).Enabled= 0 'False
Tab(0).Control(6)= "cmdNext1"
Tab(0).Control(6).Enabled= 0 'False
Tab(0).ControlCount= 7
TabCaption(1) = "Tab 1"
TabPicture(1) = "frmTL_RestoreS.frx":001C
Tab(1).ControlEnabled= 0 'False
Tab(1).Control(0)= "cmdPrevious2"
Tab(1).Control(1)= "cmdCancel2"
Tab(1).Control(2)= "cmdOK"
Tab(1).Control(3)= "lstResult"
Tab(1).Control(4)= "lblResult"
Tab(1).Control(5)= "lblMsg"
Tab(1).ControlCount= 6
TabCaption(2) = "Tab 2"
TabPicture(2) = "frmTL_RestoreS.frx":0038
Tab(2).ControlEnabled= 0 'False
Tab(2).ControlCount= 0
Begin VB.CommandButton cmdPrevious2
Caption = "上一步(&A)"
Height = 375
Left = -74040
TabIndex = 17
Top = 4800
Width = 975
End
Begin VB.CommandButton cmdCancel2
Caption = "取消(&Q)"
Height = 375
Left = -70800
TabIndex = 16
Top = 4800
Width = 1095
End
Begin VB.CommandButton cmdOK
Caption = "确定(&O)"
Height = 375
Left = -72000
TabIndex = 15
Top = 4800
Width = 1095
End
Begin VB.CommandButton cmdNext1
Caption = "下一步(&B)"
Height = 375
Left = 1680
TabIndex = 13
Top = 5520
Width = 975
End
Begin VB.CommandButton cmdCancel1
Caption = "退出(&X)"
Height = 375
Left = 3840
TabIndex = 12
Top = 5520
Width = 975
End
Begin VB.Frame Frame1
Height = 3945
Left = 120
TabIndex = 3
Top = 0
Width = 6375
Begin VB.ListBox lSt
ForeColor = &H00000000&
Height = 2220
Left = 200
Sorted = -1 'True
TabIndex = 8
Top = 1500
Width = 2655
End
Begin VB.TextBox txtLine
BackColor = &H00FFFFFF&
ForeColor = &H00800000&
Height = 2220
Left = 3030
Locked = -1 'True
MultiLine = -1 'True
ScrollBars = 2 'Vertical
TabIndex = 7
Top = 1500
Width = 3135
End
Begin VB.CommandButton cmdDelete
Caption = "移除(&D)"
Height = 315
Left = 2030
TabIndex = 6
Top = 1140
Width = 825
End
Begin VB.TextBox txtPath
Height = 270
Left = 200
Locked = -1 'True
TabIndex = 5
Top = 600
Width = 5175
End
Begin VB.CommandButton cmdBrowse
Caption = "浏览(&B)"
Height = 315
Left = 5340
TabIndex = 4
Top = 578
Width = 825
End
Begin VB.Label Label2
AutoSize = -1 'True
Caption = "恢复信息:"
Height = 180
Left = 3030
TabIndex = 11
Top = 1200
Width = 900
End
Begin VB.Label Label4
AutoSize = -1 'True
Caption = "文件列表:"
Height = 180
Left = 195
TabIndex = 10
Top = 1200
Width = 900
End
Begin VB.Label Label3
AutoSize = -1 'True
Caption = "选择路径:"
Height = 180
Left = 200
TabIndex = 9
Top = 360
Width = 900
End
End
Begin VB.Frame Frame2
Height = 135
Left = 240
TabIndex = 2
Top = 5280
Width = 6120
End
Begin VB.PictureBox Picture2
Height = 6135
Left = 6600
ScaleHeight = 6075
ScaleWidth = 195
TabIndex = 1
Top = 0
Width = 255
End
Begin MSComDlg.CommonDialog dLg
Left = 5760
Top = 4800
_ExtentX = 847
_ExtentY = 847
_Version = 393216
DialogTitle = "打开文件"
End
Begin MSComctlLib.ListView lstResult
Height = 2895
Left = -74520
TabIndex = 20
Top = 1560
Width = 5535
_ExtentX = 9763
_ExtentY = 5106
View = 2
LabelWrap = -1 'True
HideSelection = -1 'True
HideColumnHeaders= -1 'True
_Version = 393217
ForeColor = -2147483640
BackColor = -2147483643
BorderStyle = 1
Appearance = 1
NumItems = 1
BeginProperty ColumnHeader(1) {BDD1F052-858B-11D1-B16A-00C0F0283628}
Text = "结果"
Object.Width = 2540
EndProperty
End
Begin VB.Label lblResult
AutoSize = -1 'True
Caption = "恢复情况:"
Height = 180
Left = -74520
TabIndex = 19
Top = 1320
Width = 810
End
Begin VB.Label lblMsg
AutoSize = -1 'True
Caption = "提示:正在恢复数据,请等候......"
BeginProperty Font
Name = "楷体_GB2312"
Size = 14.25
Charset = 134
Weight = 700
Underline = 0 'False
Italic = -1 'True
Strikethrough = 0 'False
EndProperty
Height = 285
Left = -74640
TabIndex = 18
Top = 480
Width = 4935
End
Begin VB.Label lblMemo
AutoSize = -1 'True
Caption = "提示:"
Height = 180
Left = 120
TabIndex = 14
Top = 4080
Width = 540
End
End
End
Attribute VB_Name = "frmTL_RestoreS"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
'txtPath.IMEMode = vbIMEModeDisable 输入模式
Option Explicit
Private Declare Function GetVersionEx Lib "kernel32" Alias "GetVersionExA" (lpVersionInformation As OSVERSIONINFO) As Long
Private Type OSVERSIONINFO
dwOSVersionInfoSize As Long
dwMajorVersion As Long
dwMinorVersion As Long
dwBuildNumber As Long
dwPlatformId As Long
szCSDVersion As String * 128 ' Maintenance string for PSS usage
End Type
Private Type FilePath
sFile As String
sPath As String
End Type
Dim m_aryPath() As FilePath
Dim m_aryItem(26) As String
Private Sub cmdBrowse_Click()
Dim arySplit() As String
Dim arySplit1() As String
'传出值参数
Dim sTemp As String
Dim lMonth As Long
Dim sTable As String
Dim sString As String
Dim i As Integer, j As Integer
Dim iPos As Integer
Dim iCount() As Integer
Dim iPosBound As Integer
Dim bYhdz As Boolean
Dim bCustomer As Boolean
Dim bItem As Boolean
Dim bVendor As Boolean
Dim lVersion As Long
Dim sVersion As OSVERSIONINFO
Dim sFlag As String '版本标志
Dim lMajor As Long
Dim lMinor As Long
Dim lBuildNumber As Long
Dim lPlatForm As Long
Dim sValidFile As String
Dim sExistFile As String
Dim aryFile() As String
Dim aryTempFile() As String
Dim aryValidFile1() As String
sVersion.dwOSVersionInfoSize = 148
lVersion = GetVersionEx(sVersion)
If lVersion <> 0 Then
lMajor = sVersion.dwMajorVersion
lMinor = sVersion.dwMinorVersion
lBuildNumber = sVersion.dwBuildNumber
lPlatForm = sVersion.dwPlatformId
If lMajor = 5 And lMinor = 0 And lPlatForm = 2 And lBuildNumber = 2195 Then
sFlag = "Win2000"
ElseIf lMajor = 4 And lMinor = 10 And lPlatForm = 1 And lBuildNumber = 67766446 Then
sFlag = "Win98"
End If
End If
On Error GoTo errhandler
With dLg
.MaxFileSize = 1000
.CancelError = True
.filename = ""
.Filter = "Text File(*.txt)|*.txt"
' .Flags = cdlOFNFileMustExist Or cdlOFNHelpButton Or _
cdlOFNHideReadOnly Or cdlOFNNoReadOnlyReturn
.Flags = cdlOFNAllowMultiselect
.ShowOpen
If sFlag = "Win2000" Then
arySplit() = Split(.filename, "\")
aryFile() = Split(Trim(arySplit(UBound(arySplit))))
txtPath.text = Mid(.filename, 1, Len(.filename) - Len(arySplit(UBound(arySplit))) - 1)
ElseIf sFlag = "Win98" Then
arySplit1() = Split(.filename)
If UBound(arySplit1) = 0 And arySplit1(0) <> "" Then
arySplit = Split(.filename, "\")
aryFile() = Split(Trim(arySplit(UBound(arySplit))))
txtPath.text = Mid(.filename, 1, Len(.filename) - Len(arySplit(UBound(arySplit))) - 1)
Else
arySplit = arySplit1
ReDim aryFile(UBound(arySplit) - 1)
For i = 1 To UBound(arySplit)
aryFile(i - 1) = arySplit(i)
Next i
txtPath.text = arySplit(0)
End If
End If
End With
sExistFile = ""
ReDim aryTempFile(0)
ReDim aryValidFile1(0)
For i = 0 To lSt.ListCount - 1
For j = 0 To UBound(aryFile)
If m_aryPath(i).sPath & "\" & m_aryPath(i).sFile = txtPath.text & _
"\" & aryFile(j) Then
sExistFile = sExistFile & aryFile(j) & ","
End If
Next j
Next i
If lSt.ListCount > 0 Then
For j = 0 To UBound(aryFile)
If InStr(1, sExistFile, aryFile(j)) = 0 Then
If UBound(aryTempFile) = 0 And aryTempFile(0) = "" Then
aryTempFile(0) = aryFile(j)
Else
ReDim Preserve aryTempFile(UBound(aryTempFile) + 1)
aryTempFile(UBound(aryTempFile)) = aryFile(j)
End If
End If
Next j
ElseIf lSt.ListCount = 0 Then
ReDim aryTempFile(UBound(aryFile))
aryTempFile = aryFile
End If
If Not (UBound(aryTempFile) = 0 And aryTempFile(0) = "") Then
'检测打开的文件是否是数据备份的文件
ReDim iCount(UBound(aryTempFile))
For j = 0 To UBound(aryTempFile)
For i = 0 To 26
If UCase(aryTempFile(j)) = UCase(m_aryItem(i)) Then
Exit For
Else
iCount(j) = iCount(j) + 1
End If
Next i
Next j
sValidFile = ""
For j = 0 To UBound(aryTempFile)
If (iCount(j) = 27) Or (Not ReadTextHead(txtPath.text & _
"\" & aryTempFile(j), lMonth, sTemp, sTable)) Then
sValidFile = sValidFile & aryTempFile(j) & ","
Else
If UBound(aryValidFile1) = 0 And aryValidFile1(0) = "" Then
aryValidFile1(0) = aryTempFile(j)
Else
ReDim Preserve aryValidFile1(UBound(aryValidFile1) + 1)
aryValidFile1(UBound(aryValidFile1)) = aryTempFile(j)
End If
End If
Next j
End If
If Not (UBound(aryValidFile1) = 0 And aryValidFile1(0) = "") Then
iPosBound = UBound(m_aryPath)
If iPosBound = 0 And m_aryPath(0).sFile = "" And m_aryPath(0).sPath = "" Then
ReDim Preserve m_aryPath(UBound(aryValidFile1))
Else
ReDim Preserve m_aryPath(iPosBound + UBound(aryValidFile1) + 1)
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -