Foxtable(狐表)用户栏目专家坐堂 → ftp服务器上传文件失败


  共有1586人关注过本帖平板打印复制链接

主题:ftp服务器上传文件失败

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


加好友 发短信
等级:小狐 帖子:370 积分:3195 威望:0 精华:0 注册:2016/6/16 16:11:00
ftp服务器上传文件失败  发帖心情 Post By:2016/10/8 11:05:00 [只看该作者]

 ftp1.Host="60.165.164.48"
    ftp1.Account = "8888"
    ftp1.Password = "88888888"
    ftp1.port ="21"
Dim dr As DataRow = 用户信息.Find("[Name] = '" & _UserName & "'")
If dr IsNot Nothing Then '如果找到了
    Dim File1002 As String=ProjectPath & "Attachments\Images\" & _UserName & "100user.PNG"
    Dim File2 As String=ProjectPath & "Attachments\Images\" & _UserName  & "user.PNG"
    Dim File10022 As String=ProjectPath & "Attachments\Images\" & _UserName & "$100user.PNG"
    Dim File22 As String=ProjectPath & "Attachments\Images\" & _UserName  & "$user.PNG"
    Dim File As String="/" & FileSys.GetName( File2 )  '其中FileSys.GetName是获取不含路径文件名
    msgbox(file)
    Dim File100 As String="/" & FileSys.GetName( File1002 )  '其中FileSys.GetName是获取不含路径文件名
    msgbox(file100)
    If FileSys.FileExists( File22 ) Then '如果指定的文件存在
        FileSys.MoveFile(File22,File2, True) '移动头像文件
msgbox("移动头像")
        If ftp1.FileExists(file) Then
            msgbox(ftp1.FileExists(file))
            ftp1.DeleteFile(file)
           msgbox(ftp1.DeleteFile(file))
            ftp1.Upload(File2,File, False) '复制头像文件
        Else
            ftp1.Upload(File2,File, False) '复制头像文件
        End If
    End If
    If FileSys.FileExists( File10022 ) Then '如果指定的文件存在
        FileSys.MoveFile(File10022,File1002, True) '移动头像文件
        If ftp1.FileExists(file100) Then
            msgbox(ftp1.FileExists(file100) )
            ftp1.DeleteFile(file100)
msgbox(ftp1.DeleteFile(file100))
            ftp1.Upload(File1002,File100, False) '复制头像文件
        Else
            ftp1.Upload(File1002,File100,False) '复制头像文件
        End If
    End If
上述红色的地方显示上传失败,不知道怎么回事。ftp1本身上传没有问题。


 回到顶部