找回密码
 加入
搜索
查看: 1742|回复: 1

[AU3基础] _FTP_FileRead读不出数据[已解决]

[复制链接]
发表于 2017-4-21 21:00:35 | 显示全部楼层 |阅读模式
本帖最后由 heroxianf 于 2017-4-22 21:54 编辑

#PRE_UseX64=n
#include <FTPEx.au3>

Local $server = "192.168.10.111"
Local $username = "test"
Local $pass = ""
Local $RemoteFile = "/Ver.ini"
Local $LocalFile = ".\test.ini"
Local $Passive = "1"
Local $Port = "21"
Local $Open = _FTP_Open('MyFTP Control')
Local $Conn = _FTP_Connect($Open, $server, $username, $pass ,$Passive ,$Port)

;~ _FTP_FileGet($Conn, $RemoteFile, $LocalFile)
Local $tt = _FTP_FileOpen($Conn, $RemoteFile)
;~ MsgBox(0, "", $tt)
Local $ttt = _FTP_FileRead($tt, "") ;不知道怎么写
MsgBox(0, "", $ttt)
_FTP_FileClose($tt)

Local $Ftpc = _FTP_Close($Open)
 楼主| 发表于 2017-4-22 21:52:49 | 显示全部楼层
仔细看了下帮助文件,读取出来是二进制的,这样测试成功限制正常字符。
Local $text = _FTP_FileOpen($Conn, $UpDir)
Local $file = _FTP_FileRead($text, 1024*1024)
ConsoleWrite(BinaryToString($file, 4) & @CRLF) ;返回UTF8编码执行可成功
_FTP_FileClose($text)
您需要登录后才可以回帖 登录 | 加入

本版积分规则

QQ|手机版|小黑屋|AUTOIT CN ( 鲁ICP备19019924号-1 )谷歌 百度

GMT+8, 2024-4-27 03:37 , Processed in 0.076183 second(s), 23 queries .

Powered by Discuz! X3.5 Licensed

© 2001-2024 Discuz! Team.

快速回复 返回顶部 返回列表