Thanks for looking into it ,
I refered many sites for the solution ,I can say there might be solution at may places but the issue was with my FTP settings. which was allowing me to read and drop the file but now allowing me to read the names of subfolders inside the root foler.
my same below code worked fine,
class Program
{
static void Main(string[] args)
{
ftpissue1();
}
public static void ftpissue1()
{
List<string> result = new List<string>();
WebResponse response = null;
StreamReader reader = null;
try
{
FtpWebRequest reqFTP;
reqFTP = (FtpWebRequest)FtpWebRequest.Create(new Uri("ftp://10.88.0.78/IN"));
reqFTP.UseBinary = true;
reqFTP.Credentials = new NetworkCredential("ABC", "ABC");
reqFTP.Method = WebRequestMethods.Ftp.ListDirectoryDetails;
response = reqFTP.GetResponse();
reader = new StreamReader(response.GetResponseStream());
while (!reader.EndOfStream)
{
result.Add(reader.ReadLine());
}
}
catch
{
if (reader != null)
{
reader.Close();
}
if (response != null)
{
response.Close();
}
}
}
}
</string></string>
I could say , its very imp to note that ftp has different settings for reading, renaming file, delete, drop etc.