Foxtable(狐表)用户栏目专家坐堂 → 关于图片浏览器问题


  共有5204人关注过本帖树形打印复制链接

主题:关于图片浏览器问题

帅哥哟,离线,有人找我吗?
有点甜
  11楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:版主 帖子:85326 积分:427815 威望:0 精华:5 注册:2012/10/18 22:13:00
  发帖心情 Post By:2019/1/3 15:40:00 [显示全部帖子]

如果图片没有删除,说明你路径有问题。

 

Dim path As String = ProjectPath & "照片/"

msgbox(path)
For Each dr As DataRow In DataTables("客户档案").Select("姓名 is not null")
    Dim str1 As String = dr("姓名")
    Dim str2 As String = ""
    If dr.isnull("身份证") = False Then
        str2 = str2 & right(dr("身份证"),6)
    End If
    dr("身份证照片") = Nothing
    For Each file As String In FileSys.GetFiles(path)
        Dim name As String = FileSys.GetName(file)
        If name.Contains(str1) AndAlso name.Contains(str2) Then
            FileSys.CopyFile(file, ProjectPath & "照片\客户身份证/" & name, True)

msgbox(file)
            FileSys.DeleteFile(file, 2, 2)

        End If
    Next
Next


 回到顶部
帅哥哟,离线,有人找我吗?
有点甜
  12楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:版主 帖子:85326 积分:427815 威望:0 精华:5 注册:2012/10/18 22:13:00
  发帖心情 Post By:2019/1/3 18:08:00 [显示全部帖子]

贴出你所写全部代码。

 回到顶部
帅哥哟,离线,有人找我吗?
有点甜
  13楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:版主 帖子:85326 积分:427815 威望:0 精华:5 注册:2012/10/18 22:13:00
  发帖心情 Post By:2019/1/3 20:47:00 [显示全部帖子]

无法理解你写这段代码有什么用,那改成

 

Dim path As String = ProjectPath & "照片/客户身份证/"
For Each dr As DataRow In DataTables("客户档案").Select("姓名 is not null")
    Dim str As String = dr("姓名")
    If dr.isnull("身份证") = False Then
        str = str & right(dr("身份证"),6)
    End If
    For Each file As String In FileSys.GetFiles(path)
        Dim name As String = FileSys.GetName(file)       
        If name.Contains(str) Then
            Dim ls = dr.Lines("身份证照片")
            If ls.contains(name) = False Then
                ls.Remove(name)
                Tables("客户档案").Current.DataRow.Lines("身份证照片") = ls
            End If
        End If
    Next
Next


 回到顶部
帅哥哟,离线,有人找我吗?
有点甜
  14楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:版主 帖子:85326 积分:427815 威望:0 精华:5 注册:2012/10/18 22:13:00
  发帖心情 Post By:2019/1/3 21:34:00 [显示全部帖子]

改成

 

Dim path As String = ProjectPath & "照片/"

msgbox(path)
For Each dr As DataRow In DataTables("客户档案").Select("姓名 is not null")
    Dim str1 As String = dr("姓名")
    Dim str2 As String = ""
    If dr.isnull("身份证") = False Then
        str2 = str2 & right(dr("身份证"),6)
    End If
    dr("身份证照片") = Nothing
    For Each file As String In FileSys.GetFiles(path)
        Dim name As String = FileSys.GetName(file)
        If name.Contains(str1) AndAlso name.Contains(str2) Then
            FileSys.CopyFile(file, ProjectPath & "照片\客户身份证/" & name, True)

msgbox(file)
            FileSys.DeleteFile(file, 2, 2)

        End If
    Next
Next


 回到顶部
帅哥哟,离线,有人找我吗?
有点甜
  15楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:版主 帖子:85326 积分:427815 威望:0 精华:5 注册:2012/10/18 22:13:00
  发帖心情 Post By:2019/1/3 21:45:00 [显示全部帖子]

代码改成28楼啊

 

Dim path As String = ProjectPath & "照片/"

msgbox(path)
For Each dr As DataRow In DataTables("客户档案").Select("姓名 is not null")
    Dim str1 As String = dr("姓名")
    Dim str2 As String = ""
    If dr.isnull("身份证") = False Then
        str2 = str2 & right(dr("身份证"),6)
    End If
    dr("身份证照片") = Nothing
    For Each file As String In FileSys.GetFiles(path)
        Dim name As String = FileSys.GetName(file)
        If name.Contains(str1) AndAlso name.Contains(str2) Then
            FileSys.CopyFile(file, ProjectPath & "照片\客户身份证/" & name, True)

msgbox(file)
            FileSys.DeleteFile(file, 2, 2)

        End If
    Next
Next


 回到顶部
帅哥哟,离线,有人找我吗?
有点甜
  16楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:版主 帖子:85326 积分:427815 威望:0 精华:5 注册:2012/10/18 22:13:00
  发帖心情 Post By:2019/1/3 22:18:00 [显示全部帖子]

Dim path As String = ProjectPath & "照片/"
msgbox(path)
Dim dr = Tables("客户档案").current
Dim str1 As String = dr("姓名")
Dim str2 As String = ""
If dr.isnull("身份证") = False Then
    str2 = str2 & right(dr("身份证"),6)
End If
dr("身份证照片") = Nothing
For Each file As String In FileSys.GetFiles(path)
    Dim name As String = FileSys.GetName(file)
    If name.Contains(str1) AndAlso name.Contains(str2) Then
        FileSys.CopyFile(file, ProjectPath & "照片\客户身份证/" & name, True)       
        msgbox(file)
        FileSys.DeleteFile(file, 2, 2)
    End If
Next

 


 回到顶部
帅哥哟,离线,有人找我吗?
有点甜
  17楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:版主 帖子:85326 积分:427815 威望:0 精华:5 注册:2012/10/18 22:13:00
  发帖心情 Post By:2019/1/3 22:40:00 [显示全部帖子]

以下是引用裴保民在2019/1/3 22:26:00的发言:
一个客户好几张照片如果只删除选中的照片,而不是该客户名下的所有照片,怎么实现呢?

 

Dim pv As WinForm.PictureViewer = e.Form.Controls("PictureViewer")
Dim fl As String = pv.SelectedItem
If fl > "" Then
    pv.DeleteFile(fl)
    FileSys.DeleteFile(fl, 2,2)
End If


 回到顶部
总数 18 上一页 1 2