版主,请帮忙在下面代码加入自动压缩,上传ftp的
Dim cmd2 As New SQLCommand
Dim dt2 As Date
cmd2.C
cmd2.CommandText = "Select GetDate()"
dt2 = cmd2.ExecuteScalar()
Dim ftp1 As New FtpClient
Ftp1.Host = "0"
Ftp1.Account = "0"
Ftp1.Password = "0"
If Tables("成品").Current.IsNull("图纸号") Then
MessageBox.Show("必须输入图纸号!","提示",MessageBoxButtons.OK,MessageBoxIcon.Information)
Return
End If
Dim proDir As String = Tables("成品").Current("图纸号")
Dim dlg As New OpenFileDialog
dlg.Filter= "图形文件|*.bmp;*.jpg;*.gif"
dlg.MultiSelect = True
If dlg.ShowDialog = DialogResult.OK Then
Dim fpath As String = "/包装/" & prodir & "/"
If ftp1.DirExists(fpath) = False Then ftp1.MakeDir(fpath)
Dim str As String = ""
For Each fl As String In dlg.FileNames
Dim fileInfo As new FileInfo(fl)
If Ftp1.Upload(fl,fpath & filesys.GetName(fl),True) = True Then
str &= fpath & FileSys.GetName(fl) & vbcrlf
End If
Next
Tables("成品").Current("包装资料")= str
Tables("成品").Current("包装日期") = cmd2.ExecuteScalar()
Tables("成品").Current.Save()
Messagebox.show("上传完成!","提示",MessageBoxButtons.OK,MessageBoxIcon.Information)
End If
[此贴子已经被作者于2017/12/19 9:38:35编辑过]