📄 tfolder.frm
字号:
VERSION 5.00
Object = "{67397AA1-7FB1-11D0-B148-00A0C922E820}#6.0#0"; "MSADODC.OCX"
Begin VB.Form Tfolder
BorderStyle = 1 'Fixed Single
Caption = "导入媒体文件"
ClientHeight = 5475
ClientLeft = 45
ClientTop = 435
ClientWidth = 6870
Icon = "Tfolder.frx":0000
LinkTopic = "Form1"
MaxButton = 0 'False
MinButton = 0 'False
ScaleHeight = 5475
ScaleWidth = 6870
StartUpPosition = 1 '所有者中心
Begin VB.CommandButton Command3
Caption = "返回主界面"
Height = 495
Left = 2160
TabIndex = 6
Top = 4800
Width = 2415
End
Begin MSAdodcLib.Adodc Adodc1
Height = 375
Left = 5880
Top = 4080
Visible = 0 'False
Width = 1200
_ExtentX = 2117
_ExtentY = 661
ConnectMode = 0
CursorLocation = 3
IsolationLevel = -1
ConnectionTimeout= 15
CommandTimeout = 30
CursorType = 3
LockType = 3
CommandType = 8
CursorOptions = 0
CacheSize = 50
MaxRecords = 0
BOFAction = 0
EOFAction = 0
ConnectStringType= 1
Appearance = 1
BackColor = -2147483643
ForeColor = -2147483640
Orientation = 0
Enabled = -1
Connect = ""
OLEDBString = ""
OLEDBFile = ""
DataSourceName = ""
OtherAttributes = ""
UserName = ""
Password = ""
RecordSource = ""
Caption = "Adodc1"
BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851}
Name = "宋体"
Size = 9
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
_Version = 393216
End
Begin VB.ListBox List1
Height = 3120
Left = 120
TabIndex = 3
Top = 960
Width = 6615
End
Begin VB.Frame Frame1
Caption = "请正确输入源文件所在文件夹"
Height = 735
Left = 120
TabIndex = 0
Top = 120
Width = 6615
Begin VB.CommandButton Command2
Caption = "查找"
Height = 375
Left = 4560
TabIndex = 5
Top = 240
Width = 975
End
Begin VB.CommandButton Command1
Caption = "全部导入"
Enabled = 0 'False
Height = 375
Left = 5640
TabIndex = 2
Top = 240
Width = 855
End
Begin VB.TextBox Text1
Height = 375
Left = 120
TabIndex = 1
Top = 240
Width = 4335
End
End
Begin VB.Label Label1
Caption = "说明:1,批量导入的文件信息不全,建议在导入后再对其信息进行编辑; 2,选择文件后可按""DEL""键删除!"
ForeColor = &H000000FF&
Height = 375
Left = 360
TabIndex = 4
Top = 4200
Width = 5775
End
End
Attribute VB_Name = "Tfolder"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Sub Command1_Click()
Dim s As String
Dim fileB As String
Dim fileE As String
Dim filename As String
If List1.ListCount = 0 Then Exit Sub
For I = 1 To List1.ListCount
s = List1.List(I - 1)
fileB = ""
fileE = ""
For j = 1 To Len(s)
If Mid$(s, j, 1) = "." Then
fileB = Left$(s, j - 1)
fileE = Mid$(s, j + 1, Len(s) - j)
End If
Next
'确定文件真实路径
On Error Resume Next
filename = songPath & "\" & fileE & "\" & s
nn = ReadFromFile("set", "num")
'判断是否有此格式文件的文件夹
If Dir(songPath & "\" & fileE) = "" Then MkDir songPath & "\" & fileE
Name Text1.Text & "\" & List1.List(I - 1) As filename
Adodc1.Recordset.AddNew
Adodc1.Recordset.Fields("编号") = Format(nn, "000000")
Adodc1.Recordset.Fields("字数") = Len(s)
Adodc1.Recordset.Fields("字母") = mHZtoSM.HZtoSMEx(s)
Adodc1.Recordset.Fields("歌名") = fileB
Adodc1.Recordset.Fields("歌手") = "未知"
Adodc1.Recordset.Fields("性别") = "未知"
Adodc1.Recordset.Fields("格式") = fileE
Adodc1.Recordset.Fields("产地") = "未知"
Adodc1.Recordset.Fields("日期") = "未知"
Adodc1.Recordset.Fields("类型") = "未知"
Adodc1.Recordset.Fields("位置") = filename
Adodc1.Recordset.Update
reg = WriteToFile("set", "num", CStr(Val(nn) + 1))
Next
songManger.Adodc1.Refresh
MsgBox "数据建立完毕!", vbOKOnly, "提示"
End Sub
Private Sub Command2_Click()
FindFiles Text1.Text, "", ""
If List1.ListCount > 0 Then
Command1.Enabled = True
Else
MsgBox "请检查路径是否正确!", vbOKOnly, "警告"
End If
End Sub
Private Sub Command3_Click()
Unload Me
End Sub
Private Sub Form_Load()
With Adodc1
.ConnectionString = conn
.CommandTimeout = 30
.CommandType = adCmdText
.CursorLocation = adUseClient
.RecordSource = "select * from songlist"
.Refresh
End With
End Sub
Private Sub List1_KeyDown(KeyCode As Integer, Shift As Integer)
On Error Resume Next
If KeyCode = 46 Then List1.RemoveItem List1.ListIndex
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -