以文本方式查看主题

-  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=119408)

--  作者:lzw001
--  发布时间:2018/5/24 12:11:00
--  关于多文件列如何删除服务器对应照片或文件
老师,我发现删了多文件列之后,服务器中还是有保留的,本地这里是我是选择删了的,这个要怎么弄呢,求解
--  作者:有点甜
--  发布时间:2018/5/24 12:18:00
--  

http://www.foxtable.com/webhelp/scr/2716.htm

 

BeforeDeleteFile事件,合成ftp路径,把对应的文件删除

 

http://www.foxtable.com/webhelp/scr/1410.htm

 


--  作者:lzw001
--  发布时间:2018/5/24 14:54:00
--  
老师,我这样写的话,路径文件那里应该怎么改成当前行的文件名称呢?

If e.DataCol.Name="财务收入_上传文件" Then  \'OrElse e.DataCol.Name="财务支出_上传支出凭据"
    Dim ftp1 As New FtpClient
    ftp1.Host="120.79.56.106"
    ftp1.Account = "ftpuser"
    ftp1.Password = "qwe123,."
    If ftp1.DeleteFile("\\web文件管理器\\Desert.jpg") = True Then
        Messagebox.show("删除完成!","提示",MessageBoxButtons.OK,MessageBoxIcon.Information)
    Else
        Messagebox.show("删除失败!","提示",MessageBoxButtons.OK,MessageBoxIcon.Information)
    End If
End If

--  作者:lzw001
--  发布时间:2018/5/24 14:59:00
--  
这样
If e.DataCol.Name="财务收入_上传文件" Then  \'OrElse e.DataCol.Name="财务支出_上传支出凭据"
    Dim ftp1 As New FtpClient
    ftp1.Host="120.79.56.106"
    ftp1.Account = "ftpuser"
    ftp1.Password = "qwe123,."
    If ftp1.DeleteFile("\\web文件管理器\\e.DataRow.Lines("财务收入_上传文件")") = True Then
        Messagebox.show("删除完成!","提示",MessageBoxButtons.OK,MessageBoxIcon.Information)
    Else
        Messagebox.show("删除失败!","提示",MessageBoxButtons.OK,MessageBoxIcon.Information)
    End If
End If

--  作者:有点甜
--  发布时间:2018/5/24 15:02:00
--  

 

If e.DataCol.Name="财务收入_上传文件" Then  \'OrElse e.DataCol.Name="财务支出_上传支出凭据"
    Dim ftp1 As New FtpClient
    ftp1.Host="120.79.56.106"
    ftp1.Account = "ftpuser"
    ftp1.Password = "qwe123,."
    msgbox(e.filename)
    If ftp1.DeleteFile(e.filename) = True Then
        Messagebox.show("删除完成!","提示",MessageBoxButtons.OK,MessageBoxIcon.Information)
    Else
        Messagebox.show("删除失败!","提示",MessageBoxButtons.OK,MessageBoxIcon.Information)
    End If
    ftp1.close
End If


--  作者:lzw001
--  发布时间:2018/5/24 15:45:00
--  
可以了,谢谢