在开发过程中,本地驱动器列表框名为Drive1,本地和服务器端目录列表框分别名为Dir1和 Dir2,本地和服务器端文件列表框分别名为File1和File2,界面上有上至下四个按钮分别名为Command1至Command4。 [Visual Basic代码] Private Sub Drive1_Change() (1) ’更新目录列表框的路径 End Sub Private Sub Dir1_Change() File1.Path=Dir1.Path ’更新文件列表框file1的路径 End Sub Private Sub Dir2_Change() File2.Path=Dir2.Path ’更新文件列表框file2的路径 End Sub ’连接服务器 Private Sub Command1_Click() Dim user,password As String user= (2) (“请输入用户名:”) password= (2) (“请输入口令:”) If check User(user,password)Then ’若用户名和口令正确 Dir2.Path=…… ’打开服务器上某一指定目录 Else: MsgBox“口令错误,请重试!” End If End Sub ’上传文件 Private Sub Command2_Click() Dim fso As new FileSystemObject,f As File,i As Integer If File1.FileName=""Then ’判断是否已经选中文件 MsgBox“请选择本地的文件!” Exit Sub End If ’创建文件系统对象 Set fso=CreateObject(“Scripting.FileSystemObject”) ’上传文件 For i=0 To (3) ’遍历文件列表框File1中的全体文件 If (4) Then’若该文件被选中 Set f=fso. (5) (Dir1.Path & “\” & File1.List(i)) f.Copy Dir2.Path & “\” & File1.List(i),True ’复制文件至服务器端 End If Next File2.Refresh End Sub ’下载文件 Private Sub Command3_Click() …… End Sub ’退出程序 Private Sub Command4_Click() End End Sub