目前進度
[左側本地目錄]
1.本地目錄點一下可以啟動檔案總管來指定目錄
2.可以詳列出目錄,顯示畫面雷同檔案總管
2.1 顯示目錄與檔案名稱
2.2 顯示檔案大小
此區待修改項目
1.顯示資料夾圖示
2.Size 顯示計算要再調整計算公式,盡量計算方法與檔案總管相同
3.使用List View 研究能否以欄位來達到排序
4.將FTP連線成功的目錄顯示在右側遠端目錄中
[FTP功能]
1.可以成功連接FTP
2.可以取得遠端檔案目錄
此區待修改項目
1.無法手動切斷連線
2.將FTP模組化
[計算檔案大小]
Public Function GetFileSize(ByVal TheSize As ULong) As String
Dim SizeType As String = ""
Try
Select Case TheSize
Case Is >= 1099511627776
DoubleBytes = CDbl(TheSize / 1099511627776) 'TB
Return FormatNumber(DoubleBytes, 2) & " TB"
Case 1073741824 To 1099511627775
DoubleBytes = CDbl(TheSize / 1073741824) 'GB
Return FormatNumber(DoubleBytes, 2) & " GB"
Case 1048576 To 1073741823
DoubleBytes = CDbl(TheSize / 1048576) 'MB
Return FormatNumber(DoubleBytes, 2) & " MB"
Case 1024 To 1048575
DoubleBytes = CDbl(TheSize / 1024) 'KB
Return FormatNumber(DoubleBytes, 2) & " KB"
Case 0 To 1023
DoubleBytes = TheSize ' bytes
Return FormatNumber(DoubleBytes, 2) & " bytes"
Case Else
Return ""
End Select
Catch
Return ""
End Try
End Function
[檢查資料夾是否存在]
Imports System.IO
Private Function Check_Folder(ByVal folderPath As String) As Boolean
If Directory.Exists(folderPath) Then
Return True
Else
Return False
End If
End Function
參考文件:
如何:以 FTP 列出目錄內容