Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
当我发送 PASV 命令时,我收到了来自 FTPServer 的重播消息,如下所示
227进入被动模式(159,153,197,77,194,82)
我将如何从这个字符串重播消息中获取 IP 地址。并将其转换为 InternetAddress....
谢谢
227 Entering Passive Mode (h1,h2,h3,h4,p1,p2)是语法,h1-h4 是 IP 地址的 4 个字节,p1 和 p2 是 2 个字节的端口号,但我不明白你如何将其转换为 rsc822 互联网地址,它的local@domain形式是。哦,顺便说一句,您可以使用string.substring(27,string.length-2).split(",")将参数作为单独的字符串获取,然后Byte.parseByte(string)用于每个值
227 Entering Passive Mode (h1,h2,h3,h4,p1,p2)
local@domain
string.substring(27,string.length-2).split(",")
Byte.parseByte(string)