Foxtable(狐表)用户栏目专家坐堂 → 添加附件异常


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

主题:添加附件异常

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


加好友 发短信
等级:六尾狐 帖子:1368 积分:12183 威望:0 精华:0 注册:2012/3/5 11:32:00
添加附件异常  发帖心情 Post By:2024/9/26 16:07:00 [显示全部帖子]

            For q As Integer = 1 To latestMailItem.Attachments.Count
            Dim files As String
            Dim FileName As String
            FileName = latestMailItem.Attachments(q).FileName
            Dim fmat As String = Filename
            Dim pathfile As String
            pathfile =  ProjectPath & "Attachments\" & "files" & "\" &  fmat
            If FileSys.DirectoryExists(ProjectPath & "Attachments\" & "files") = False Then
                FileSys.CreateDirectory(ProjectPath & "Attachments\" & "files")
            End If
            lst.Add(pathfile)
            latestMailItem.Attachments(q).SaveAsFile(pathfile) 
        Next


图片点击可在新窗口打开查看此主题相关图片如下:屏幕截图 2024-09-26 160106.png
图片点击可在新窗口打开查看

点打开邮件 会弹出这个信息

附件列 添加异常 ,  写入绝对路径 ,  文件夹里面的问题 打不开 ,请教什么问题呢
[此贴子已经被作者于2024/9/26 16:07:53编辑过]

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


加好友 发短信
等级:六尾狐 帖子:1368 积分:12183 威望:0 精华:0 注册:2012/3/5 11:32:00
  发帖心情 Post By:2024/10/17 10:21:00 [显示全部帖子]

 篮板请教下

        Dim lst As New List(of String)
        If latestMailItem.Attachments.Count > 0 Then
            For q As Integer = 1 To latestMailItem.Attachments.Count
                
                Dim files As String
                Dim FileName As String
                FileName = latestMailItem.Attachments(q).FileName
                Dim fmat As String = Filename
                Dim pathfile As String
                pathfile =  ProjectPath & "Attachments\" & "files" & "\" &  fmat
                If FileSys.DirectoryExists(ProjectPath & "Attachments\" & "files") = False Then
                    FileSys.CreateDirectory(ProjectPath & "Attachments\" & "files")
                End If
                lst.Add(pathfile)
                latestMailItem.Attachments(q).SaveAsFile(pathfile)  '复制到emailsend 文件夹里面
            Next
        End If
        
        dra.Lines("附件") = lst
        dra.save

我的代码如上  添付的时候 已经是按照集合的形式添付的 了 , 不知道错在哪里  求明指点

 回到顶部