- var socket:Socket = new Socket("www.kelew.com",21)
- socket.addEventListener(ProgressEvent.SOCKET_DATA,socketData)
- function socketData(e:ProgressEvent):void
- {
- var d:String = socket.readUTFBytes(socket.bytesAvailable)
- if (d.indexOf("ProFTPD")!=-1)
- {
- socket.writeUTFBytes("USER 用户名\n")
- socket.writeUTFBytes("PASS 密码\n")
- }else if(d.indexOf("User 用户名")!=-1)
- {
- socket.writeUTFBytes("help \n")
- }
- socket.flush()
- }