Dim ftp1 As New FtpClient
ftp1.Host="tangrenjie.net"
ftp1.Account = "ftp"
ftp1.Password = "Zhengbe7761"
For Each File As String In FileSys.GetFiles("c:\图片\")
ftp1.upload(file, "/" & Filesys.getname(file),True)
Next
If Messagebox.show("上传完成!","提示",MessageBoxButtons.OK,MessageBoxIcon.Information)
Else
Messagebox.show("上传失败!","提示",MessageBoxButtons.OK,MessageBoxIcon.Information)
End If
现在是上传到固定的位置 例如 www.pic/pic。目录下
如果我要上传到www.pic/pic/当前日期 目录下应该怎么改代码?参考过下面的代码,但是不是很明白,请各位大师指点啊
Dim ex As New Exporter
ex.SourceTableName = "订单"
ex.FilePath = "c:\temp\gd.mdb"
ex.Filter = "日期 = #" & Date.Today & "#"
If FileSys.FileExists(ex.FilePath) Then '如果目标文件已经存在
FileSys.DeleteFile(ex.FilePath) '则删除之
End If
ex.Export()
'上传到FTP服务器
Dim ftp1 As new ftpclient
ftp1.host="ftp.baidu.com"
ftp1.Account = "foxtable"
ftp1.password = "168168"
ftp1.upload(ex.FilePath,"/gd.mdb",True) '上传