📄 frmfileview.frm
字号:
EndProperty
Height = 6000
Left = 0
ScaleHeight = 5940
ScaleWidth = 4155
TabIndex = 1
Top = 0
Width = 4215
Begin MSComctlLib.ImageCombo ClientDrives
Height = 330
Left = 120
TabIndex = 10
Top = 360
Width = 3975
_ExtentX = 7011
_ExtentY = 582
_Version = 393216
ForeColor = -2147483640
BackColor = -2147483643
ImageList = "SmallIcons"
End
Begin MSComctlLib.ListView ClientFileList
Height = 4815
Left = 0
TabIndex = 5
Top = 1080
Width = 4095
_ExtentX = 7223
_ExtentY = 8493
SortKey = 2
View = 2
Arrange = 1
Sorted = -1 'True
MultiSelect = -1 'True
LabelWrap = -1 'True
HideSelection = 0 'False
OLEDragMode = 1
OLEDropMode = 1
_Version = 393217
Icons = "LargeIcons"
SmallIcons = "SmallIcons"
ForeColor = -2147483640
BackColor = -2147483643
BorderStyle = 1
Appearance = 1
OLEDragMode = 1
OLEDropMode = 1
NumItems = 3
BeginProperty ColumnHeader(1) {BDD1F052-858B-11D1-B16A-00C0F0283628}
Text = "File Name"
Object.Width = 2540
EndProperty
BeginProperty ColumnHeader(2) {BDD1F052-858B-11D1-B16A-00C0F0283628}
SubItemIndex = 1
Text = "Size"
Object.Width = 2540
EndProperty
BeginProperty ColumnHeader(3) {BDD1F052-858B-11D1-B16A-00C0F0283628}
SubItemIndex = 2
Text = "Type"
Object.Width = 2540
EndProperty
End
Begin MSComctlLib.Toolbar Toolbar1
Height = 330
Left = 0
TabIndex = 7
Top = 720
Width = 8670
_ExtentX = 15293
_ExtentY = 582
ButtonWidth = 609
ButtonHeight = 582
AllowCustomize = 0 'False
Appearance = 1
Style = 1
ImageList = "ImageList1"
_Version = 393216
BeginProperty Buttons {66833FE8-8583-11D1-B16A-00C0F0283628}
NumButtons = 11
BeginProperty Button1 {66833FEA-8583-11D1-B16A-00C0F0283628}
Object.ToolTipText = "Go Up"
ImageIndex = 1
EndProperty
BeginProperty Button2 {66833FEA-8583-11D1-B16A-00C0F0283628}
Style = 3
EndProperty
BeginProperty Button3 {66833FEA-8583-11D1-B16A-00C0F0283628}
Object.ToolTipText = "Delete"
ImageIndex = 3
EndProperty
BeginProperty Button4 {66833FEA-8583-11D1-B16A-00C0F0283628}
Object.ToolTipText = "Upload"
ImageIndex = 9
EndProperty
BeginProperty Button5 {66833FEA-8583-11D1-B16A-00C0F0283628}
Style = 3
EndProperty
BeginProperty Button6 {66833FEA-8583-11D1-B16A-00C0F0283628}
Object.ToolTipText = "Large Icons"
ImageIndex = 4
EndProperty
BeginProperty Button7 {66833FEA-8583-11D1-B16A-00C0F0283628}
Object.ToolTipText = "Small Icons"
ImageIndex = 5
EndProperty
BeginProperty Button8 {66833FEA-8583-11D1-B16A-00C0F0283628}
Object.ToolTipText = "List"
ImageIndex = 6
EndProperty
BeginProperty Button9 {66833FEA-8583-11D1-B16A-00C0F0283628}
Object.ToolTipText = "Details"
ImageIndex = 7
EndProperty
BeginProperty Button10 {66833FEA-8583-11D1-B16A-00C0F0283628}
Style = 3
EndProperty
BeginProperty Button11 {66833FEA-8583-11D1-B16A-00C0F0283628}
Object.ToolTipText = "New Folder"
ImageIndex = 2
EndProperty
EndProperty
End
Begin VB.Label lblClientFiles
Alignment = 2 'Center
BackColor = &H8000000D&
Caption = "My Files"
BeginProperty Font
Name = "Tahoma"
Size = 11.25
Charset = 0
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H8000000E&
Height = 300
Left = 0
TabIndex = 3
Top = 0
Width = 4215
End
End
Begin MSComctlLib.StatusBar Status
Align = 2 'Align Bottom
Height = 315
Left = 0
TabIndex = 0
Top = 6000
Width = 8670
_ExtentX = 15293
_ExtentY = 556
_Version = 393216
BeginProperty Panels {8E3867A5-8586-11D1-B16A-00C0F0283628}
NumPanels = 3
BeginProperty Panel1 {8E3867AB-8586-11D1-B16A-00C0F0283628}
EndProperty
BeginProperty Panel2 {8E3867AB-8586-11D1-B16A-00C0F0283628}
Bevel = 0
Object.Width = 115
MinWidth = 115
EndProperty
BeginProperty Panel3 {8E3867AB-8586-11D1-B16A-00C0F0283628}
EndProperty
EndProperty
BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851}
Name = "Tahoma"
Size = 8.25
Charset = 0
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
End
Begin VB.Menu mnuFile
Caption = "&File"
Begin VB.Menu mnuDelete
Caption = "&Delete"
Shortcut = {DEL}
End
End
Begin VB.Menu mnuView
Caption = "&View"
Begin VB.Menu mnuLargeIcons
Caption = "Lar&ge Icons"
End
Begin VB.Menu mnuSmallIcons
Caption = "S&mall Icons"
End
Begin VB.Menu mnuList
Caption = "&List"
Checked = -1 'True
End
Begin VB.Menu mnuDetails
Caption = "&Details"
End
Begin VB.Menu sep1
Caption = "-"
End
Begin VB.Menu mnuViewRefresh
Caption = "&Refresh Views"
Shortcut = {F5}
End
End
Begin VB.Menu mnuClient
Caption = "&Client"
Begin VB.Menu mnuUpload
Caption = "&Upload Selected Item(s)"
Shortcut = ^U
End
Begin VB.Menu sep2
Caption = "-"
End
Begin VB.Menu mnuClientMoveTo
Caption = "&Move to..."
End
Begin VB.Menu mnuRenameClientFile
Caption = "&Rename"
End
Begin VB.Menu mnuDeleteClientFile
Caption = "&Delete"
End
Begin VB.Menu sep3
Caption = "-"
End
Begin VB.Menu mnuNewClient
Caption = "&New"
Begin VB.Menu mnuNewClientFolder
Caption = "&Folder"
End
End
End
Begin VB.Menu mnuServer
Caption = "&Server"
Begin VB.Menu mnuDownload
Caption = "&Download Selected Item(s)"
Shortcut = ^D
End
Begin VB.Menu mnuSep1
Caption = "-"
End
Begin VB.Menu mnuServerMoveTo
Caption = "&Move to..."
End
Begin VB.Menu mnuRenameServerFile
Caption = "&Rename"
End
Begin VB.Menu mnuDeleteServerFile
Caption = "&Delete"
End
Begin VB.Menu mnuSep2
Caption = "-"
End
Begin VB.Menu mnuExecuteServerProgram
Caption = "E&xecute (on server)"
End
Begin VB.Menu mnusep3
Caption = "-"
End
Begin VB.Menu mnuNew
Caption = "New"
Begin VB.Menu mnuNewFolder
Caption = "&Folder"
End
End
End
End
Attribute VB_Name = "frmFileView"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Dim FirstRun As Boolean
Dim WithEvents Que As FileQue
Attribute Que.VB_VarHelpID = -1
Dim WithEvents UpQue As FileQue
Attribute UpQue.VB_VarHelpID = -1
Dim Focus As String
Private Source As String
Sub AddFileToQue(Path As String, DestPath As String)
On Error Resume Next
Que.AddFile (Path & ">" & DestPath)
End Sub
Sub AddFolderToQue(Path As String, DestPath As String, WhichQue As FileQue)
On Error Resume Next
If Right(Path, 1) <> "\" Then Path = Path + "\"
'This adds the files inside 'Path' (if any)
mypath = Path
myname = Dir(mypath)
Do While myname <> "": DoEvents
If myname <> "." And myname <> ".." Then
If (GetAttr(mypath & myname) And vbDirectory) = vbDirectory Then GoTo next1
WhichQue.AddFile (mypath & myname & ">" & DestPath)
End If
next1:
myname = Dir
Loop
Dim objDir1 As Folder
Dim objDir2 As Folder
Set objDir1 = objFso.GetFolder(Path)
'This part adds all the files inside subfolders
For Each objDir2 In objDir1.SubFolders
parentfolders = Mid(Path, Len(ClientPath), Len(Path) - Len(ClientPath))
Call AddFolderToQue(Path & objDir2.Name, ServerPath & parentfolders & "\" & objDir2.Name & "\", WhichQue) 'recursive call to this function
Next objDir2
Set objDir1 = Nothing
Set objDir2 = Nothing
End Sub
Sub GetServerFilesFromFolder(Path As String)
If Right(Path, 1) <> "\" Then Path = Path + "\"
frmMain.Winsock.SendData ("GET_DIR_CONTENTS=" & Path)
WaitingForContents = True
Do While WaitingForContents = True: DoEvents: Loop
End Sub
Sub RefreshClientView()
Call ChowFromFolder(ClientFileList, ClientPath, "*.*")
End Sub
Private Sub RefreshServerView()
Call frmMain.Winsock.SendData("DIR " + ServerPath)
ServerFileList.MousePointer = 13
End Sub
Private Sub ShowFocus(str As String)
Select Case str
Case "Client"
lblClientFiles.ForeColor = vbActiveTitleBarText
lblClientFiles.BackColor = vbActiveTitleBar
lblServerFiles.ForeColor = vbInactiveTitleBarText
lblServerFiles.BackColor = vbInactiveTitleBar
mnuServer.Enabled = False
mnuClient.Enabled = True
Focus = "Client"
Case "Server"
lblClientFiles.ForeColor = vbInactiveTitleBarText
lblClientFiles.BackColor = vbInactiveTitleBar
lblServerFiles.ForeColor = vbActiveTitleBarText
lblServerFiles.BackColor = vbActiveTitleBar
mnuClient.Enabled = False
mnuServer.Enabled = True
Focus = "Server"
End Select
End Sub
Private Sub ClientDrives_Change()
Call WriteINI("Andromeda", "LastClientFolder", ClientDrives.Text, DLL())
End Sub
Private Sub ClientDrives_Click()
Call ChowFromFolder(ClientFileList, ClientDrives.Text, "*.*")
End Sub
Private Sub ClientDrives_GotFocus()
ShowFocus "Client"
End Sub
Private Sub ClientDrives_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
Dim fs As New FileSystemObject
newpath = ClientDrives.Text
If Right(newpath, 1) <> "\" Then newpath = newpath + "\"
If fs.FolderExists(newpath) = True Then
Call ChowFromFolder(ClientFileList, newpath, "*.*")
For x = 1 To ClientDrives.ComboItems.Count
If LCase(ClientDrives.ComboItems(x).Text) = LCase(newpath) Then
ClientDrives.ComboItems(x).Selected = True
Exit Sub
End If
Next x
Dim itm As ComboItem
Set itm = ClientDrives.ComboItems.Add(, , ClientDrives.Text, "folder")
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -