1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21
| foreach (string s in LOCALIP.Split('.'))
{
portData += s + ',';
}
port = rnd.Next(6000, 7000);
port1 = port / 256;
port2 = port % 256;
portData += port1.ToString() + "," + port2.ToString();
SendCommand("PORT " + portData, "200");
tmp = lastResponse;
dataSocket = new Socket(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp);
IPAddress adress = Dns.GetHostEntry(host).AddressList[0];
IPEndPoint ep = new IPEndPoint(adress, port + 1);
dataSocket.Bind(ep);
dataSocket.Listen(10);
SendCommand("RETR AFR-TESTG.dnc", "NOTEST");
dataSocket.Receive(buffer, buffer.Length, 0); |
Partager