Foxtable(狐表)用户栏目专家坐堂 → 上传图片按钮


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

主题:上传图片按钮

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


加好友 发短信
等级:九尾狐 帖子:2437 积分:22520 威望:0 精华:0 注册:2011/3/29 17:14:00
上传图片按钮  发帖心情 Post By:2019/10/18 17:58:00 [只看该作者]


想做一个上传图片按钮

根据当前订单表选择的行 的客户列,地址列,单号列重命名文件
同时需要压缩图片尺寸,存到指定的目录

[此贴子已经被作者于2019/10/18 17:58:02编辑过]

 回到顶部
帅哥,在线噢!
有点蓝
  2楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:超级版主 帖子:105473 积分:536350 威望:0 精华:9 注册:2015/6/24 9:21:00
  发帖心情 Post By:2019/10/18 20:41:00 [只看该作者]

参考:http://www.foxtable.com/webhelp/topics/1410.htm

类似

Dim r As rwo = Tables().current
If r Is Nothing Then Return
Dim f1 As String = r("客户列") & r("地址列") & r("单号列")
Dim dlg As New OpenFileDialog
dlg.Filter= "图片文件|*.jpg;*.png"
If dlg.ShowDialog = DialogResult.OK Then
    Dim f2 As String = FileSys.GetName(dlg.FileName)
    Dim name As String = f1 & "." & f2.Split(".")(1)

    Dim img As image = getImage(dlg.FileName)
    Dim bmp As bitmap
    If img.width > 400 Then
        If 400 * (img.height / img.width) > 300 Then
            bmp = new bitmap(img, 400*(300/(400*(img.height/img.width))), 300)
        Else
            bmp = new bitmap(img, 400, 400 * (img.height / img.width))
        End If
    End If
    bmp.save(ProjectPath & name,img.RawFormat)
    bmp.Dispose
    

    Dim ftp1 As New FtpClient
    ftp1.Host="196.128.143.28"
    ftp1.Account = "foxuser"
    ftp1.Password = "138238110"
    If ftp1.Upload(ProjectPath & name ,name ) = True Then
        Messagebox.show("上传完成!","提示",MessageBoxButtons.OK,MessageBoxIcon.Information)
    Else
        Messagebox.show("上传失败!","提示",MessageBoxButtons.OK,MessageBoxIcon.Information)
    End If
End If

 回到顶部