以文本方式查看主题

-  Foxtable(狐表)  (http://foxtable.com/bbs/index.asp)
--  专家坐堂  (http://foxtable.com/bbs/list.asp?boardid=2)
----  图片管理器另存问题  (http://foxtable.com/bbs/dispbbs.asp?boardid=2&id=126948)

--  作者:douglas738888
--  发布时间:2018/11/1 15:58:00
--  图片管理器另存问题

请教老师,使用图片管理器,但单独设了个按钮,用于对图片管理器选中的图片另存于自定义的路径中,下面代码报错,字符串...转换到BOOLEAN无效

麻烦老师看看,哪里代码错了

 

Dim piv As WinForm.PictureViewer = e.Form.Controls("PictureViewer1")
If piv.SelectedItem Then

Else
    \'--------------打开存放窗口·自由选择·文件存放路径 
    Dim dlg  As New FolderBrowserDialog
    If dlg.ShowDialog = DialogResult.Ok  Then
        Dim path As String = dlg.SelectedPath & "\\" 
        \'--------------FTP
        Dim ftp1 As New FtpClient
        ftp1.Host = *****
        ftp1.Account = ******
        ftp1.Password = *****
        ftp1.RootDir = RootDir
        \'---------------FTP·下载
        Dim dr As Row = Tables("事件主表").Current
            If dr.IsNull("上传事件资料_Jpg图片") = True Then

                Messagebox.Show(dr("事件_主题") & "    无可下载文件!","提示",MessageBoxButtons.OK,MessageBoxIcon.Information)
            Else
                Dim Path1 As String \'指定下载字符
                If dr("上传事件资料_Jpg图片") IsNot Nothing Then 
                    Path1 = Path & "\\" & dr("上传事件资料_Jpg图片")
                    ftp1.Download(dr("上传事件资料_Jpg图片"),Path1,True)
                End If
                Messagebox.show("文件下载成功!" & vbcrlf & "文件名称: " & dr("上传事件资料_Jpg图片"),"提示",MessageBoxButtons.OK,MessageBoxIcon.Information)
            End If
        ftp1.Close
    End If
End If

[此贴子已经被作者于2018/11/1 16:13:41编辑过]

--  作者:有点甜
--  发布时间:2018/11/1 17:28:00
--  

Dim piv As WinForm.PictureViewer = e.Form.Controls("PictureViewer1")
If piv.SelectedItem > "" Then
    \'--------------打开存放窗口·自由选择·文件存放路径
    Dim dlg  As New FolderBrowserDialog
    If dlg.ShowDialog = DialogResult.Ok  Then
        Dim path As String = dlg.SelectedPath & "\\"
        \'--------------FTP
        Dim ftp1 As New FtpClient
        ftp1.Host = "" \'*****
        ftp1.Account = "" \'******
        ftp1.Password = "" \'*****
        ftp1.RootDir = "" \'RootDir
        \'---------------FTP·下载
        msgbox(piv.SelectedItem)
        ftp1.Download(piv.SelectedItem,Path & FileSys.GetName(piv.SelectedItem), True)       
        ftp1.Close
    End If
End If