G
Guest
This is just plain odd. Here is my code:
Console.WriteLine("Connecting to server to list directory...");
Uri uri = new Uri(Settings.FtpServer);
FtpWebRequest listRequest = (FtpWebRequest)WebRequest.Create(uri);
listRequest.Credentials = new
NetworkCredential(Settings.FtpUser, Settings.FtpPassword);
listRequest.Method = WebRequestMethods.Ftp.ListDirectory;
listRequest.KeepAlive = false;
listRequest.UseBinary = false;
listRequest.UsePassive = false;
FtpWebResponse listResponse =
(FtpWebResponse)listRequest.GetResponse();
StreamReader reader = new
StreamReader(listResponse.GetResponseStream());
Console.WriteLine("List Response:");
Console.WriteLine(reader.ReadToEnd());
I get the following output:
Connecting to server to list directory...
List Response:
A.zip
B.zip
C.zip
(which are the files on the ftp server)
Running the EXACT same code on a DIFFERENT client machine, hitting the EXACT
same ftp server. I get this:
Connecting to server to list directory...
List Response:
<HTML>
<meta http-equiv="Content-Type" content="text-html; charset=UTF-8">
<HEAD>
<TITLE>FTP root at 172.17.2.20. </TITLE>
</HEAD>
<BODY>
<H1>FTP root at 172.17.2.20. </H1>
<HR>
<PRE>
01/18/06 06:41PM <DIR> <A HREF="/./">.</A>
01/18/06 06:41PM <DIR> <A HREF="/../">..</A>
01/07/03 12:00AM 199 <A HREF="/A.zip">A.zip</A>
01/18/06 01:01AM 225 <A HREF="/B.zip">B.zip</A>
07/26/06 12:32PM 5,902 <A HREF="/C.zip">C.zip</A>
</PRE>
</HR>
</BODY>
</HTML>
It is returning the listing of directory names as HTML. Has anyone seen
this before? I haven't been able to figure out what is different about the
two client machines or how to fix it.
Thanks,
Brian Orrell
Pariveda Solutions
Console.WriteLine("Connecting to server to list directory...");
Uri uri = new Uri(Settings.FtpServer);
FtpWebRequest listRequest = (FtpWebRequest)WebRequest.Create(uri);
listRequest.Credentials = new
NetworkCredential(Settings.FtpUser, Settings.FtpPassword);
listRequest.Method = WebRequestMethods.Ftp.ListDirectory;
listRequest.KeepAlive = false;
listRequest.UseBinary = false;
listRequest.UsePassive = false;
FtpWebResponse listResponse =
(FtpWebResponse)listRequest.GetResponse();
StreamReader reader = new
StreamReader(listResponse.GetResponseStream());
Console.WriteLine("List Response:");
Console.WriteLine(reader.ReadToEnd());
I get the following output:
Connecting to server to list directory...
List Response:
A.zip
B.zip
C.zip
(which are the files on the ftp server)
Running the EXACT same code on a DIFFERENT client machine, hitting the EXACT
same ftp server. I get this:
Connecting to server to list directory...
List Response:
<HTML>
<meta http-equiv="Content-Type" content="text-html; charset=UTF-8">
<HEAD>
<TITLE>FTP root at 172.17.2.20. </TITLE>
</HEAD>
<BODY>
<H1>FTP root at 172.17.2.20. </H1>
<HR>
<PRE>
01/18/06 06:41PM <DIR> <A HREF="/./">.</A>
01/18/06 06:41PM <DIR> <A HREF="/../">..</A>
01/07/03 12:00AM 199 <A HREF="/A.zip">A.zip</A>
01/18/06 01:01AM 225 <A HREF="/B.zip">B.zip</A>
07/26/06 12:32PM 5,902 <A HREF="/C.zip">C.zip</A>
</PRE>
</HR>
</BODY>
</HTML>
It is returning the listing of directory names as HTML. Has anyone seen
this before? I haven't been able to figure out what is different about the
two client machines or how to fix it.
Thanks,
Brian Orrell
Pariveda Solutions