Foxtable(狐表)用户栏目专家坐堂 → 双击截图网络版


  共有1911人关注过本帖树形打印复制链接

主题:双击截图网络版

帅哥哟,离线,有人找我吗?
yifan3429
  1楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:九尾狐 帖子:2466 积分:22761 威望:0 精华:0 注册:2011/3/29 17:14:00
双击截图网络版  发帖心情 Post By:2018/2/3 17:50:00 [只看该作者]

If e.Col.name = "图片" Then
    Dim dr As DataRow = e.Row.DataRow
    If dr.IsNull ("类别") Or Dr.IsNull("楼层")  Or Dr.IsNull("产品名") Or Dr.IsNull("单位") Or Dr.IsNull("房间") Then
        MessageBox.show("带 * 为必填","提示")
        e.cancel = True
    Else
        baseMainForm.WindowState= Windows.forms.FormWindowState.Minimized
        ClipBoard.Clear
        Dim proc As new Process
        proc.File = ApplicationPath & "/capture.exe"
        proc.WaitForClose = True
        proc.Start
        If ClipBoard.GetImage IsNot Nothing Then
            Dim f As String =   e.Row("编号") & "\" & e.Row("楼层") &"\" & e.Row("房间")&"\" & e.Row("产品名") & e.Row("产品号") & e.Row("单位") &".png"
            Dim path As String = e.Col.DataCol.DefaultFolder
            If path = "" Then                '''
                path =Vars("IPM")
                'msgbox(1)
            End If
            basemainform.WindowState = 2
            Dim dir As String = FileSys.GetParentPath(path & "/" & f)
            If FileSys.DirectoryExists(dir) = False Then FileSys.CreateDirectory(dir)
            ClipBoard.GetImage.save(path & "/" & f)
            e.Row(e.Col.name) = f
            Dim  ftp1 As  New  FtpClient
            ftp1.Host=
            ftp1.Account =  
            ftp1.Password =  
            Dim path2 As String = ""
            Dim file As String = "1.艾迪尔报价库" & "\"  & e.Row("编号") & "\" & e.Row("楼层") &"\" & e.Row("房间")
            '& e.Row("产品名") & e.Row("产品号") & e.Row("单位") &".png"
            For Each s As String In file.split("\")
                path2 = path2 & "/" & s
                If ftp1.DirExists(path2) = False Then
                    ftp1.MakeDir(path2)
                End If
            Next
            
            If ftp1.Upload(path & "/" & f, path2 & "/" & e.Row("产品名") & e.Row("产品号") & e.Row("单位") &".png") = True Then
                
                If  ftp1.Upload(path & "\" & f, "/" & f) = True Then
                    Messagebox.show("上传完成!","提示",MessageBoxButtons.OK,MessageBoxIcon.Information)
                Else
                    Messagebox.show("上传失败!","提示",MessageBoxButtons.OK,MessageBoxIcon.Information)
                End If
            End If
            e.cancel = True
            Tables("报价清单").Current.Save() '保存文件的行
        End If
    End If
End If


这个代码是同时写入本地和FTP  我想改成纯 FTP 写入  不需要本地存储   还有   path =Vars("IPM")  

DataTables("报价清单").DataCols("图片").DefaultFolder = Vars("IPM")
DataTables("报价清单").DataCols("图片").SourceFolder = "D:\"
上面的代码只能写入默认地址  我想远程的  地址  账号 密码 路径  也在AfterOpenProject 写入   
 
[此贴子已经被作者于2018/2/3 17:50:44编辑过]

 回到顶部
帅哥哟,离线,有人找我吗?
wei0769
  2楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:八尾狐 帖子:1816 积分:19334 威望:0 精华:0 注册:2013/4/10 14:38:00
  发帖心情 Post By:2018/2/4 9:24:00 [只看该作者]


 回到顶部
帅哥哟,离线,有人找我吗?
有点甜
  3楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:版主 帖子:85326 积分:427815 威望:0 精华:5 注册:2012/10/18 22:13:00
  发帖心情 Post By:2018/2/4 18:49:00 [只看该作者]

以下是引用yifan3429在2018/2/3 17:50:00的发言:
 
DataTables("报价清单").DataCols("图片").DefaultFolder = Vars("IPM")
DataTables("报价清单").DataCols("图片").SourceFolder = "D:\"
 
上面的代码只能写入默认地址  我想远程的  地址  账号 密码 路径  也在AfterOpenProject 写入   
 
[此贴子已经被作者于2018/2/3 17:50:44编辑过]

 

参考 http://www.foxtable.com/webhelp/scr/2040.htm

 


 回到顶部
帅哥哟,离线,有人找我吗?
yifan3429
  4楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:九尾狐 帖子:2466 积分:22761 威望:0 精华:0 注册:2011/3/29 17:14:00
  发帖心情 Post By:2018/2/6 16:24:00 [只看该作者]

If ftp1.Upload(path & "/" & f, path2 & "/" & e.Row("产品名") & e.Row("产品号") & e.Row("单位") &".png") = True Then
                
                If  ftp1.Upload(path & "\" & f, "/" & f) = True Then
                    Messagebox.show("上传完成!","提示",MessageBoxButtons.OK,MessageBoxIcon.Information)
                Else
                    Messagebox.show("上传失败!","提示",MessageBoxButtons.OK,MessageBoxIcon.Information)
                End If
            End If
            e.cancel = True
            Tables("报价清单").Current.Save() '保存文件的行
        End If
    End If
End If


这个是写反了吗,每次都显示上传失败  实际上文件已上传

 回到顶部
帅哥哟,离线,有人找我吗?
有点甜
  5楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:版主 帖子:85326 积分:427815 威望:0 精华:5 注册:2012/10/18 22:13:00
  发帖心情 Post By:2018/2/6 16:45:00 [只看该作者]

加入代码,看弹出的路径是否正确

 

msgbox(path & "/" & f)

msgbox(path2 & "/" & e.Row("产品名") & e.Row("产品号") & e.Row("单位") &".png")

msgbox(path & "\" & f)

msgbox("/" & f)


 回到顶部