以文本方式查看主题 - Foxtable(狐表) (http://foxtable.com/bbs/index.asp) -- 专家坐堂 (http://foxtable.com/bbs/list.asp?boardid=2) ---- 双击截屏 判断 (http://foxtable.com/bbs/dispbbs.asp?boardid=2&id=113634) |
-- 作者:yifan3429 -- 发布时间:2018/1/19 17:51:00 -- 双击截屏 判断 需要在前面确认 "缘起项目"产品名称""产品编号" 三列不能为空 代码位置在DoubleClick 双击单元格后执行。 If e.Col.name = "图片" Then 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("产品编号")&".png" \'Dim f As String = e.Row("客户名称") & "\\" & e.Row("楼层")& "\\" & "3.报价配图" & "\\" & Format( Date.Today,"yyyy-MM-dd") & "\\"& e.Row("产品名") &"-" & e.Row("产品号")&".png" Dim path As String = e.Col.DataCol.DefaultFolder If path = "" Then path ="D:\\艾迪尔整体定制\\TOCASA2017\\3.产品库图片" 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 = ftp1.Host= ftp1.Account = ftp1.Password = Dim path2 As String = "" Dim file As String = "3.产品库图片" & "\\" & 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("产品编号") & ".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
|
-- 作者:有点甜 -- 发布时间:2018/1/19 17:59:00 -- if e.row("缘起项目") <> Nothing AndAlso e.Row("产品名称") <> Nothing AndAlso e.Row("产品编号") <> Nothing Then |