473,386 Members | 1,823 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

ListDirectory

Hello All
I had used "WebRequestMethods.Ftp.ListDirectory"
but it returns a string contains html format
I thought it returns a string that contains files names
how we can resolve that?
May 15 '07 #1
5 3128
On 15 Mag, 10:58, Just close your eyes and see
<Justcloseyoureyesand...@discussions.microsoft.com wrote:
Hello All
I had used "WebRequestMethods.Ftp.ListDirectory"
but it returns a string contains html format
I thought it returns a string that contains files names
how we can resolve that?
What the string conteins?

May 15 '07 #2
The data returned by a FTP server responding to a « LIST » command is not
a standard.. The format of the returned directory list can be customized by
the FTP admin, so there is absolutely no guarantee that the format will
match the one your use in your application.

The solution is to reconfigure the LIST command on your FTP server. If
this is not possible, you have to do the job with the http data returned by
the server. Don't forget that other FTP sever may return a completely
different format...

Steph.

"Just close your eyes and see"
<Ju*********************@discussions.microsoft.com wrote in message
news:AA**********************************@microsof t.com...
Hello All
I had used "WebRequestMethods.Ftp.ListDirectory"
but it returns a string contains html format
I thought it returns a string that contains files names
how we can resolve that?

May 15 '07 #3
this is a sample of what i get
>HTML>
<HEAD>
<TITLE>FTP root at ftp.myServer.com. </TITLE>
</HEAD>
<BODY>
<H1>FTP root at ftp.myServer.com. </H1>
<HR>
<PRE>
05/03/07 09:17PM <DIR<A HREF="/13558/">13558</A>
May 15 '07 #4
httpwebrequest by default users the http protocol, hence the return is html
even from the ftp method call - its a get response protocol unlike real ftp.
You probably need to use FtpWebRequest: instead.

http://msdn2.microsoft.com/en-us/lib...ebrequest.aspx

Regards

John Timney (MVP)
http://www.johntimney.com
http://www.johntimney.com/blog
"Just close your eyes and see"
<Ju*********************@discussions.microsoft.com wrote in message
news:A8**********************************@microsof t.com...
this is a sample of what i get
>>HTML>
<HEAD>
<TITLE>FTP root at ftp.myServer.com. </TITLE>
</HEAD>
<BODY>
<H1>FTP root at ftp.myServer.com. </H1>
<HR>
<PRE>
05/03/07 09:17PM <DIR<A HREF="/13558/">13558</A>

May 15 '07 #5
On 15 Mag, 12:17, Just close your eyes and see
<Justcloseyoureyesand...@discussions.microsoft.com wrote:
this is a sample of what i get>HTML>

<HEAD>
<TITLE>FTP root at ftp.myServer.com. </TITLE>
</HEAD>
<BODY>
<H1>FTP root at ftp.myServer.com. </H1>
<HR>
<PRE>
05/03/07 09:17PM <DIR<A HREF="/13558/">13558</A>
John Timney (MVP) gave you an answer.
Anyway you can retrieve the information from the html response.

May 15 '07 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Jörg Maier | last post by:
Hey guys, i have a big problem using Tkinter and pexpect in cygwin. i try to program an winscp-like rsync Program for all posix Platforms (linux, macosx, cygwin). i got a class SslConnection...
4
by: Ben Dewey | last post by:
Hey, I have only been playing with regular expressions for some time. I am working on some code that parses and object 560 event log. I have created two expressions the first one which works...
0
by: aloneplayer | last post by:
Hi, All, I wrote a function to share a folder to individual user account with WMI. When I call it : ShareFolder("c:\\test", "Test", "Shared by Riven", 8, Environment.MachineName,...
2
by: Ian Hannah | last post by:
I am running the following code (using VS 2005) with the appropriate username and password and the request always timeouts: FtpWebRequest request =...
7
by: Mark Rae | last post by:
Hi, Has anyone successfully used the FTP stuff in the System.Net namespace against a VMS FTP server? I'm trying to do this at the moment and can't even get a directory listing, although there...
2
by: dimitryous | last post by:
Hello, I just would like to read a specific (/Downloads/) directory of the client machine in order to get the latest file: My code look for text files like "quotes.txt, quotes-1.txt, ......
7
by: Lou | last post by:
What is the .NET equivelent of the iNet control I tried FtpWebRequest but that doesn't do it. All I want to do is give an ipaddress, user name and password, send a CD command and a DIR command to...
2
by: =?Utf-8?B?TXVydWdlc2FuUA==?= | last post by:
I'm trying to list out all FTP site's root directory (path) from IIS using C#(ASP.NET) code. Can anyone please suggest me sample code in C#? Thanks in advance. Regards, P.Murugesan
4
by: K Viltersten | last post by:
I noticed that when i read files from an FTP using FtpWebRequest, the file names using swedish characters seem not to be interpreted correctly. I get a square, instead. After having looked for...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.