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