?? form1.frm
字號:
On Error Resume Next
If ListView1.SelectedItem.Text <> "" Then
TextDirectory.Text = Left(ListView1.SelectedItem.Text, 2) & "\"
CmdBrowse_Click
End If
End Sub
Private Sub Command1_Click()
If d = False Then
d = True
ListView1.Visible = False
Else
d = False
ListView1.Visible = True
End If
End Sub
Private Sub Command2_Click()
On Error Resume Next
Dim Folder As Folder
Dim file As file
Dim drive As drive
Dim SubFolder As Folder
Dim i As Integer
Dim Str As String
' If strDrive = "" Then Exit Sub
' If strFolder = "" Then Exit Sub
'當前文件夾
' Set Folder = fso.GetFolder(strDrive & strFolder)
'上級文件夾
' strFolder = Left(strFolder, InStrRev(strFolder, "\") - 1)
' cmbDrives.Text = strDrive & strFolder
' ListView3.ListItems.Clear
' If Not Folder.ParentFolder Is Nothing Then
'添加子文件夾
' For Each SubFolder In Folder.ParentFolder.SubFolders
' ListView3.ListItems.Add , , SubFolder, 1, 1
' i = i + 1
' Next
'添加文件
' For Each File In Folder.ParentFolder.Files
' ListView3.ListItems.Add , , File.Name, 5, 5
' i = i + 1
' Next
' i = ListView3.ListItems.Count
' Else
' For Each File In Folder.Files
' ListView3.ListItems.Add , , File.Name, 5, 5
' i = i + 1
' Next
' i = ListView3.ListItems.Count
' For Each SubFolder In Folder.SubFolders
'lstFiles.AddItem SubFolder, i
' ListView3.ListItems.Add , , SubFolder, 1, 1
' i = i + 1
' Next
' End If
i = 0
Set Folder = fso.GetFolder(cmbDrives.Text)
cmbDrives.Text = cmbDrives.Text
ListView3.ListItems.Clear
strFolder = strFolder & "\" & Folder.Name
'添加子文件夾
For Each SubFolder In Folder.SubFolders
ListView3.ListItems.Add , , SubFolder, 1, 1
i = i + 1
Next
'添加全部文件
For Each file In Folder.Files
ListView3.ListItems.Add , , file.Name, 6, 6
i = i + 1
Next
i = ListView3.ListItems.Count
End Sub
Private Sub del_Click()
On Error Resume Next
If ListView2.SelectedItem.Text <> "" Then
If Right(TextDirectory.Text, 1) <> "\" And Right(TextDirectory.Text, 1) <> "/" Then TextDirectory.Text = TextDirectory.Text & "\"
Value& = MsgBox("你是要刪除該文件嗎?", vbYesNo + vbQuestion, "刪除文件")
If Value& = vbYes Then
FrmPass.WinSockCtl.SendData "078" & TextDirectory.Text & ListView2.SelectedItem.Text
' Call CmdBrowse_Click
FrmMain.List1.AddItem ("刪除了遠程" & TextDirectory.Text & ListView2.SelectedItem.Text & " " & Date & " " & Time & "")
Set itwms = FrmMain.ListView4.ListItems.Add(, , "刪除了遠程" & TextDirectory.Text & ListView2.SelectedItem.Text)
itwms.SubItems(1) = Date
itwms.SubItems(2) = Time
itwms.SubItems(3) = "文件刪除"
Else
MsgBox "The file selected to be deleted has not been removed.", vbInformation, "Deleting files"
End If
End If
Timer3.Enabled = True
End Sub
Private Sub delflie_Click()
On Error Resume Next
Value& = MsgBox("你是要刪除該文件嗎?", vbYesNo + vbQuestion, "刪除文件")
If Value& = vbYes Then
Kill Text1.Text
Set itwms = FrmMain.ListView4.ListItems.Add(, , "刪除了本地" & Text1.Text)
itwms.SubItems(1) = Date
itwms.SubItems(2) = Time
itwms.SubItems(3) = "文件刪除"
End If
Command2_Click
End Sub
Private Sub dowdun_Click()
Client.Show
Me.Enabled = False
End Sub
Private Sub Exit_Click()
FrmPass.Winsock1.Close
FrmPass.WinSockCtl.Close
End
End Sub
'Private Sub Combo1_Change()
'ExplorerList1.TreeDatas
'End Sub
Private Sub Form_Load()
CobView.AddItem ("大圖標")
CobView.AddItem ("自由排列")
CobView.AddItem ("列表")
CobView.AddItem ("小圖標")
CobView.ListIndex = 2
CobView2.AddItem ("大圖標")
CobView2.AddItem ("自由排列")
CobView2.AddItem ("列表")
CobView2.AddItem ("小圖標")
CobView2.ListIndex = 2
Dim drive As drive
Dim i As Integer
i = 0
'添加驅動器
ListView3.ColumnHeaders.Add , , "文件夾路徑", 2500, , 2
For Each drive In fso.Drives
cmbDrives.AddItem drive.Path, i
i = i + 1
Next
cmbDrives.ListIndex = 1
'初始化遠程文件目錄
FrmMain.ListView2.ColumnHeaders.Add , , "文件名", 2500
FrmMain.ListView2.ColumnHeaders.Add , , "類型", 2500
FrmMain.ListView2.ColumnHeaders.Add , , "大小", 2500
FrmMain.ListView1.ColumnHeaders.Add , , "文件夾路徑", 2500, , 2
FrmMain.ListView4.ColumnHeaders.Add , , "事件", 5000
FrmMain.ListView4.ColumnHeaders.Add , , "日期", 3000
FrmMain.ListView4.ColumnHeaders.Add , , "時間", 3000
FrmMain.ListView4.ColumnHeaders.Add , , "類型", 3000
ListView2.Enabled = False
ListView1.BackColor = &H80000000
ListView2.BackColor = &H80000000
'ListView2.BackColor = &H80000009 '白色
d = False
End Sub
' Clean up...
Private Sub Form_Unload(Cancel As Integer)
' On Error Resume Next
'
'FrmPass.Winsock1.Close
'FrmPass.WinSockCtl.Close
End Sub
Private Sub ListView1_Click()
On Error Resume Next
If ListView1.SelectedItem.Text <> "" Then
TextDirectory.Text = ListView1.SelectedItem.Text
FrmPass.WinSockCtl.SendData "119" & TextDirectory.Text
End If
End Sub
Private Sub ListView1_DblClick()
On Error Resume Next
If ListView1.SelectedItem.Text <> "" Then
TextDirectory.Text = ListView1.SelectedItem.Text & "\"
ListView1.SelectedItem.SmallIcon = ImageList.ListImages.Item(2).Picture
ListView1.refresh
Combo2.Text = TextDirectory.Text
CmdBrowse_Click
End If
End Sub
Private Sub ListView1_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
Dim litem As ListItem
If Button = 2 Then
Set litem = ListView1.SelectedItem
If ListView1.HitTest(X, Y) Is litem Then
If litem Is Nothing Then Exit Sub
PopupMenu nf
Exit Sub
End If
End If
End Sub
Private Sub ListView1_OLEDragDrop(Data As MSComctlLib.DataObject, Effect As Long, Button As Integer, Shift As Integer, X As Single, Y As Single)
If Data.GetFormat(vbCFFiles) = True Then
'If Data.GetFormat(vbCFFiles) Then
Dim Str, str1 As String
Str = LCase(Mid(Data.Files(1), Len(Data.Files(1)) - 2, 3))
str1 = Data.Files(1)
MsgBox "" & str1
FrmMain.Text1.Text = str1
Setver.Show
End If
End Sub
Private Sub ListView2_Click()
On Error Resume Next
If ListView2.SelectedItem.Text <> "" Then
If Right(TextDirectory.Text, 1) <> "\" And Right(TextDirectory.Text, 1) <> "/" Then TextDirectory.Text = TextDirectory.Text & "\"
FrmPass.WinSockCtl.SendData "120" & TextDirectory.Text & ListView2.SelectedItem.Text
'Text1.Text = TextDirectory.Text & ListFiles.SelectedItem.Text
End If
End Sub
Private Sub ListView2_DblClick()
On Error Resume Next
If ListView2.SelectedItem.Text <> "" Then
If Right(TextDirectory.Text, 1) <> "\" And Right(TextDirectory.Text, 1) <> "/" Then TextDirectory.Text = TextDirectory.Text & "\"
FrmPass.WinSockCtl.SendData "083" & TextDirectory.Text & ListView2.SelectedItem.Text
End If
End Sub
Private Sub ListView2_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
Dim litem As ListItem
If Button = 2 Then
Set litem = ListView2.SelectedItem
If ListView2.HitTest(X, Y) Is litem Then
If litem Is Nothing Then Exit Sub
PopupMenu meutu
Exit Sub
End If
End If
End Sub
Private Sub ListView2_OLEDragDrop(Data As MSComctlLib.DataObject, Effect As Long, Button As Integer, Shift As Integer, X As Single, Y As Single)
If Data.GetFormat(vbCFFiles) Then
Dim Str, str1 As String
Str = LCase(Mid(Data.Files(1), Len(Data.Files(1)) - 2, 3))
str1 = Data.Files(1)
MsgBox "" & str1
FrmMain.Text1.Text = str1
Setver.Show
End If
End Sub
Private Sub ListView3_Click()
Dim Folder As Folder
Dim SubFolder As Folder
Dim file As file
On Error Resume Next
If InStr(ListView3.SelectedItem.Text, ":\") Then
Exit Sub
Else
Text1.Text = cmbDrives.Text & "\" & ListView3.SelectedItem.Text
Set file = fso.GetFile(Text1.Text)
Txt.Text = file.Size
End If
End Sub
Private Sub ListView3_DblClick()
Dim Folder As Folder
Dim SubFolder As Folder
Dim file As file
Dim i As Integer
i = 0
On Error Resume Next
'If Not ListView3.ListItems.Count > 1 Then
If InStr(ListView3.SelectedItem.Text, ":\") Then
Set Folder = fso.GetFolder(ListView3.SelectedItem.Text)
cmbDrives.Text = ListView3.SelectedItem.Text
ListView3.ListItems.Clear
strFolder = strFolder & "\" & Folder.Name
'添加子文件夾
For Each SubFolder In Folder.SubFolders
ListView3.ListItems.Add , , SubFolder, 1, 1
i = i + 1
Next
'添加全部文件
For Each file In Folder.Files
ListView3.ListItems.Add , , file.Name, 6, 6
i = i + 1
Next
i = ListView3.ListItems.Count
End If
' End If
End Sub
Private Sub ListView3_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
Dim litem As ListItem
If Button = 2 Then
Set litem = ListView3.SelectedItem
If ListView3.HitTest(X, Y) Is litem Then
If litem Is Nothing Then Exit Sub
PopupMenu meul
Exit Sub
End If
End If
End Sub
Private Sub ListView3_OLEDragDrop(Data As MSComctlLib.DataObject, Effect As Long, Button As Integer, Shift As Integer, X As Single, Y As Single)
'
If Data.GetFormat(vbCFFiles) Then
Dim Str, str1 As String
Str = LCase(Mid(Data.Files(1), Len(Data.Files(1)) - 2, 3))
str1 = Data.Files(1)
'FrmMain.ListView3.ListItems.Add , , str1
FileCopy Str, cmbDrives.Text
End If
End Sub
'Private Sub mnuFileAbout_Click()
' Call ShellAbout(hWnd, "About the VB Explorer demo# ....adapted from EnumDeskVB", _
' "Copyright
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -