以文本方式查看主题

-  Foxtable(狐表)  (http://www.foxtable.com/bbs/index.asp)
--  专家坐堂  (http://www.foxtable.com/bbs/list.asp?boardid=2)
----  图片上传后怎么删除本地文件?  (http://www.foxtable.com/bbs/dispbbs.asp?boardid=2&id=32403)

--  作者:jinzhengbe
--  发布时间:2013/5/1 21:36:00
--  图片上传后怎么删除本地文件?

Dim ftp1 As New FtpClient
ftp1.Host="tang.net"
ftp1.Account = "ftp1"
ftp1.Password = "111"

For Each File As String In FileSys.GetFiles("\\\\Pc-server\\图片\\图片1")
   ftp1.upload(file, "/" & Filesys.getname(file),True)
Next
If     Messagebox.show("上传完成!","提示",MessageBoxButtons.OK,MessageBoxIcon.Information)
Else
    Messagebox.show("上传失败!","提示",MessageBoxButtons.OK,MessageBoxIcon.Information)
End If

 

再这段代码后面加上一个代码,图片上传完成后删除所有图片文件。该怎么写呢?谢谢


--  作者:fjlclxj
--  发布时间:2013/5/1 22:06:00
--  

If FileSys.FileExists(file) Then \'如果指定的文件存在
FileSys.DeleteFile(file
,2,2) \'则彻底删除之
End
If