Dim pv As WinForm.PictureViewer = e.Form.Controls("PictureViewer1") If dr IsNot Nothing Then '如果找到的话
Dim ls = dr.Lines("附件")
For Each f As String In dlg.FileNames
Dim file = "/上下游公司名录附件/" & dr("公司") & "/" & filesys.GetName(f)
If ftp1.DirExists("/上下游公司名录附件/" & dr("公司")) = False Then
ftp1.MakeDir("/上下游公司名录附件/" & dr("公司"))
End If
Dim Result As DialogResult
If ftp1.FileExists(file) Then
Result = MessageBox.Show("文件已经存在,是否覆盖?", "提示", MessageBoxButtons.YesNo, MessageBoxIcon.Question)
End If
If result = Nothing OrElse result = DialogResult.Yes Then
If ftp1.Upload(f,file,True) = True Then
If ls.contains(file) = False Then
ls.add(file)
pv.AddFile(file)
End If
Else
MessageBox.Show( f & "上传失败" ,"提示" ,MessageBoxButtons.OK,MessageBoxIcon.Question)
End If
End If
Next