Dim dlg As New OpenFileDialog Dim piv As WinForm.PictureViewer = e.Form.Controls("PictureViewer1") dlg.Filter= "图形文件|*.bmp;*.jpg;*.gif" If dlg.ShowDialog = DialogResult.OK Then Dim fname As String = "/" & filesys.GetName(dlg.fileName) If piv.FTPclient.Upload(fname, dlg.FileName) Then msgbox("上传成功") piv.AddFile(fname) End If End If