heroxianf 发表于 2017-4-21 21:00:35

_FTP_FileRead读不出数据[已解决]

本帖最后由 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)

heroxianf 发表于 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)
页: [1]
查看完整版本: _FTP_FileRead读不出数据[已解决]