Foxtable(狐表)用户栏目专家坐堂 → 关于显示-FTP远程文件的代码索取


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

主题:关于显示-FTP远程文件的代码索取

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


加好友 发短信
等级:贵宾 帖子:35433 积分:178524 威望:0 精华:3 注册:2013/3/30 16:36:00
  发帖心情 Post By:2014/4/17 15:44:00 [只看该作者]

If e.Node.Level = 1 Then '如果单击的是第二层节点
    Dim tr As Row = Tables("文件管理").Current
    Dim dr As DataRow = e.Node.DataRow '获取生成此节点的DataRow
    
Dim ftp1 As new ftpclient

ftp1.host="120.198.124.195"
ftp1.Account = "und8042"
ftp1.password = "und8042ssa"
If ftp1.Download(dr("文件名称"),"c:\data\临时文件.doc") = True Then
    e.Form.Controls("WebBrowser1").Address="c:\data\临时文件.doc"

Else
    Messagebox.show("下载失败!","提示",MessageBoxButtons.OK,MessageBoxIcon.Information)
End If

End If



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


加好友 发短信
等级:版主 帖子:85326 积分:427815 威望:0 精华:5 注册:2012/10/18 22:13:00
  发帖心情 Post By:2014/4/17 16:10:00 [只看该作者]

试试这样写

 

If e.Node.Level = 1 Then '如果单击的是第二层节点
    Dim tr As Row = Tables("文件管理").Current
    Dim dr As DataRow = e.Node.DataRow '获取生成此节点的DataRow
    Dim ftp1 As new ftpclient
    ftp1.host="120.198.124.195"
    ftp1.Account = "und8042"
    ftp1.password = "und8042ssa"
    If ftp1.Download(dr("文件名称"),"c:\data\临时文件.doc") = True Then
        e.Form.Controls("WebBrowser1").Address = "c:\data\临时文件.doc"     
    Else
        Messagebox.show("下载失败!","提示",MessageBoxButtons.OK,MessageBoxIcon.Information)
    End If
End If

 

再看看这里,看[重要提示] http://www.foxtable.com/help/topics/2903.htm

 


 回到顶部
总数 42 上一页 1 2 3 4 5