www.pudn.com > SkyMediaSongTool.rar > addsong.frm
VERSION 5.00
Begin VB.Form Form4
BorderStyle = 1 'Fixed Single
Caption = "添加歌曲"
ClientHeight = 4125
ClientLeft = 45
ClientTop = 330
ClientWidth = 6450
Icon = "addsong.frx":0000
LinkTopic = "Form4"
LockControls = -1 'True
MaxButton = 0 'False
MinButton = 0 'False
ScaleHeight = 4125
ScaleWidth = 6450
ShowInTaskbar = 0 'False
StartUpPosition = 2 '屏幕中心
Begin VB.Frame Frame1
Caption = "歌曲信息"
Height = 3420
Left = 0
TabIndex = 3
Top = 0
Width = 6330
Begin VB.CommandButton Command4
Caption = "<<<"
Height = 300
Left = 3015
TabIndex = 27
ToolTipText = "从文件名获取编号"
Top = 420
Width = 480
End
Begin VB.TextBox TID
Height = 300
Left = 1020
MaxLength = 10
TabIndex = 16
Top = 420
Width = 1980
End
Begin VB.TextBox Tname
Height = 300
Left = 1020
TabIndex = 15
Top = 840
Width = 1980
End
Begin VB.TextBox Tsinger
Height = 300
Left = 1020
TabIndex = 14
Top = 1290
Width = 1980
End
Begin VB.TextBox Tlengthes
Height = 300
Left = 1020
TabIndex = 13
Top = 2115
Width = 1980
End
Begin VB.ComboBox Ttype
Height = 300
ItemData = "addsong.frx":030A
Left = 1020
List = "addsong.frx":035F
TabIndex = 12
Text = "流行金曲"
Top = 2520
Width = 1980
End
Begin VB.TextBox Tarea
Height = 300
Left = 1020
TabIndex = 11
Top = 2940
Width = 1980
End
Begin VB.ComboBox Tmtvorvcd
Height = 300
ItemData = "addsong.frx":041C
Left = 4560
List = "addsong.frx":0426
TabIndex = 10
Text = "0"
Top = 420
Width = 1455
End
Begin VB.TextBox Tqindex
Height = 330
Left = 4560
TabIndex = 9
Top = 840
Width = 1455
End
Begin VB.CheckBox tdiskname
Caption = "劲榜"
Height = 255
Left = 4575
TabIndex = 8
Top = 1335
Width = 1320
End
Begin VB.TextBox Ttemp
Height = 285
Left = 4500
TabIndex = 7
Top = 2070
Width = 1440
End
Begin VB.CheckBox Tsex
Caption = "电影"
Height = 240
Left = 4590
TabIndex = 6
Top = 1710
Width = 1485
End
Begin VB.ComboBox Tlanguage
Height = 300
ItemData = "addsong.frx":0430
Left = 1020
List = "addsong.frx":044C
TabIndex = 5
Text = "国语"
Top = 1680
Width = 1980
End
Begin VB.CommandButton Command3
Caption = ">>>"
Height = 315
Left = 3030
TabIndex = 4
Top = 840
Width = 465
End
Begin VB.Label Label1
Caption = "ID编号:"
Height = 255
Left = 135
TabIndex = 26
Top = 420
Width = 840
End
Begin VB.Label Label2
Caption = "歌 名:"
Height = 255
Left = 135
TabIndex = 25
Top = 840
Width = 840
End
Begin VB.Label Label3
Caption = "歌 星:"
Height = 255
Left = 135
TabIndex = 24
Top = 1260
Width = 840
End
Begin VB.Label Label4
Caption = "语 种:"
Height = 255
Left = 135
TabIndex = 23
Top = 1680
Width = 840
End
Begin VB.Label Label5
Caption = "长 度:"
Height = 255
Left = 135
TabIndex = 22
Top = 2100
Width = 840
End
Begin VB.Label Label6
Caption = "类 型:"
Height = 255
Left = 135
TabIndex = 21
Top = 2520
Width = 840
End
Begin VB.Label Label7
Caption = "音 量:"
Height = 255
Left = 135
TabIndex = 20
Top = 2940
Width = 840
End
Begin VB.Label Label8
Caption = "声 道:"
Height = 225
Left = 3585
TabIndex = 19
Top = 420
Width = 900
End
Begin VB.Label Label9
Caption = "拼音索引:"
Height = 225
Left = 3585
TabIndex = 18
Top = 885
Width = 900
End
Begin VB.Label Label10
Caption = "点击率:"
Height = 270
Left = 3570
TabIndex = 17
Top = 2100
Width = 945
End
End
Begin VB.CommandButton Command1
Caption = "添加歌曲"
Height = 450
Left = 3315
TabIndex = 2
Top = 3495
Width = 1440
End
Begin VB.CommandButton Command2
Caption = "取消"
Height = 450
Left = 4830
TabIndex = 1
Top = 3495
Width = 1440
End
Begin VB.CheckBox Check1
Caption = "跳过保存确认,直接保存"
Height = 345
Left = 735
TabIndex = 0
Top = 3540
Value = 1 'Checked
Width = 2460
End
End
Attribute VB_Name = "Form4"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Sub Command1_Click()
If Trim(TID.Text) = "" Or Trim(Tname.Text) = "" Or Trim(Tsinger.Text) = "" Then
MsgBox "填写信息错误!", vbOKOnly + vbCritical, "错误"
Exit Sub
End If
rs.Open "select * from " & Form1.Combo2.Text & " where id='" & Trim(TID.Text) & "'", conn, 1, 3
If Not (rs.EOF And rs.BOF) Then
MsgBox "ID编号重复,添加不成功!", vbOKOnly + vbCritical, "提示"
rs.Close
Exit Sub
Else
rs.AddNew
rs("id") = Trim(TID.Text)
Set addlv = Form1.LV1.ListItems.Add(, , Trim(TID.Text))
If Trim(Tname.Text) <> "" Then
rs("singname") = Trim(Tname.Text)
addlv.SubItems(1) = Trim(Tname.Text)
End If
If Trim(Tsinger.Text) <> "" Then
rs("singer") = Trim(Tsinger.Text)
addlv.SubItems(2) = Trim(Tsinger.Text)
End If
If Trim(Tlanguage.Text) <> "" Then
rs("language") = Trim(Tlanguage.Text)
addlv.SubItems(3) = Trim(Tlanguage.Text)
End If
If Trim(Tlengthes.Text) <> "" Then
rs("lengthes") = Trim(Tlengthes.Text)
addlv.SubItems(4) = Trim(Tlengthes.Text)
End If
If typetxttotypeid(Trim(Ttype.Text)) <> "" Then
rs("type") = typetxttotypeid(Trim(Ttype.Text))
addlv.SubItems(5) = typetxttotypeid(Trim(Ttype.Text))
End If
If Trim(Tarea.Text) <> "" Then
rs("area") = Trim(Tarea.Text)
addlv.SubItems(6) = Trim(Tarea.Text)
End If
If Trim(Tmtvorvcd.Text) <> "" Then
rs("mtvorvcd") = Trim(Tmtvorvcd.Text)
addlv.SubItems(7) = Trim(Tmtvorvcd.Text)
End If
If Trim(Tqindex.Text) <> "" Then
rs("qindex") = Trim(Tqindex.Text)
addlv.SubItems(8) = Trim(Tqindex.Text)
End If
If Trim(tdiskname.Value) <> "" Then
rs("diskname") = Trim(tdiskname.Value)
addlv.SubItems(9) = Trim(tdiskname.Value)
End If
If Trim(Tsex.Value) <> "" Then
rs("sex") = Trim(Tsex.Value)
addlv.SubItems(10) = Trim(Tsex.Value)
End If
If Trim(Ttemp.Text) <> "" Then
rs("temp") = Trim(Ttemp.Text)
addlv.SubItems(11) = Trim(Ttemp.Text)
End If
rs.Update
End If
rs.Close
tmppa = IIf(Right(Form1.Dir1.Path, 1) = "\", Form1.Dir1.Path, Form1.Dir1.Path & "\")
tmpn1 = tmppa & Trim(TID.Text) & ".mpg"
tmpn2 = tmppa & Trim(TID.Text) & ".mp2"
tmpn3 = tmppa & Trim(TID.Text) & ".dat"
tmpn4 = tmppa & Trim(TID.Text) & ".vob"
If fso.FileExists(tmpn1) Or fso.FileExists(tmpn2) Or fso.FileExists(tmpn3) Or fso.FileExists(tmpn4) Then
MsgBox "指定文件夹下存在同名文件,文件无法重命名!", vbOKOnly + vbCritical, "错误"
Else
Select Case LCase(Right(Form1.File1.List(Form1.File1.ListIndex), 3))
Case "mpg"
Name tmppa & Form1.File1.List(Form1.File1.ListIndex) As tmppa & Trim(TID.Text) & ".mpg"
Case "mp2"
Name tmppa & Form1.File1.List(Form1.File1.ListIndex) As tmppa & Trim(TID.Text) & ".mp2"
Case "dat"
Name tmppa & Form1.File1.List(Form1.File1.ListIndex) As tmppa & Trim(TID.Text) & ".dat"
Case "vob"
Name tmppa & Form1.File1.List(Form1.File1.ListIndex) As tmppa & Trim(TID.Text) & ".vob"
End Select
Form1.File1.Refresh
End If
Form1.Text5.Text = CStr(CLng(TID.Text) + 1)
If Check1.Value = 0 Then
MsgBox "记录保存成功!", vbOKOnly + vbInformation, "提示"
End If
Unload Me
End Sub
Private Sub Command2_Click()
Unload Form4
End Sub
Private Sub Command3_Click()
Tqindex = getpy(Tname.Text)
Tlengthes = Len(Tqindex.Text)
End Sub
Private Sub Command4_Click()
TID.Text = Left(Form1.File1.List(Form1.File1.ListIndex), Len(Form1.File1.List(Form1.File1.ListIndex)) - 4)
End Sub
Private Sub Tname_Change()
Tqindex = getpy(Tname.Text)
Tlengthes = Len(Tqindex.Text)
End Sub