Hi,
I am totally agree with @Jochen, you can use the UsePassive property to false.
Gets or sets the behavior of a client application's data transfer process.
Setting the UsePassive property to true sends the "PASV" command to the server. This command requests the server to listen on a data port and to wait for a connection rather than initiate one upon receipt of a transfer command.
For a description of the behaviors that are specified using UsePassive, see RFC 959, "File Transfer Protocol," Section 3.2, "Establishing Data Connections" and Section 4.1.2, "Transfer Parameter Commands," available at http://www.rfc-editor.org/.
<pre lang="C#">
<pre lang="C#">using System.Net;
using System.IO;
String RemoteFtpPath = &quot;ftp:
String LocalDestinationPath = &quot;Futures.20150305.gz&quot;;
String Username=&quot;yourusername&quot;;
String Password = &quot;yourpassword&quot;;
Boolean UseBinary = true;
Boolean UsePassive = false;
FtpWebRequest request = (FtpWebRequest)WebRequest.Create(RemoteFtpPath);
request.Method = WebRequestMethods.Ftp.DownloadFile;
request.KeepAlive = true;
request.UsePassive = UsePassive;
request.UseBinary = UseBinary;
request.Credentials = new NetworkCredential(Username, Password);
FtpWebResponse response = (FtpWebResponse)request.GetResponse();
Stream responseStream = response.GetResponseStream();
StreamReader reader = new StreamReader(responseStream);
using (FileStream writer = new FileStream(LocalDestinationPath, FileMode.Create))
{
long length = response.ContentLength;
int bufferSize = 2048;
int readCount;
byte[] buffer = new byte[2048];
readCount = responseStream.Read(buffer, 0, bufferSize);
while (readCount &gt; 0)
{
writer.Write(buffer, 0, readCount);
readCount = responseStream.Read(buffer, 0, bufferSize);
}
}
reader.Close();
response.Close();</pre></pre>
Hope this will help you.
thanks