1、使用
文件监视器
Dim fl2 As String = ProjectPath & "Reports\" & Tables("出库").current("出库单号") & ".pdf" '指定目标PDF文件
Dim wrt As New WordReport(Tables("出库"),tm,fl1) '定义一个WordReport
wrt.Build() '逐行生成报表
wrt.SaveToPDF(fl2) '保存为PDF文件
wrt.Quit() '退出
Dim Proc As New Process '打开PDF文件
Proc.File = fl2
Proc.Start()
Dim ftp1 As New FtpClient
ftp1.Host="196.128.143.28"
ftp1.Account = "foxuser"
ftp1.Password = "138238110"
If ftp1.Upload(fl2,"\update\" & filesys.GetName(
fl2)
) = True Then Messagebox.show("上传完成!","提示",MessageBoxButtons.OK,MessageBoxIcon.Information)
Else
Messagebox.show("上传失败!","提示",MessageBoxButtons.OK,MessageBoxIcon.Information)
End If