TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
boris_callens
NA
6
0
FtpWebRequest returns HTML, not text
Oct 3 2007 9:53 AM
I'm trying to get a directory listing from an FTP account through a proxy. Currently I get the correct results, but wrapped in an HTML page. I could off course start filtering the information out of the response, but I think there should be a cleaner way. When searching for a decent sollution, all I found were classes going back to socket level, usually not considering proxy authentication. public List
getLS() { List
result = null; if (Connect()){ WebResponse response = null; result = new List
(); reqFTP.Method = WebRequestMethods.Ftp.ListDirectory; reqFTP.UsePassive = true; reqFTP.Proxy = new WebProxy("internet:80"); reqFTP.Proxy.Credentials = new NetworkCredential(username, password); response = reqFTP.GetResponse(); StreamReader reader = new StreamReader(response.GetResponseStream()); while (!reader.EndOfStream) { result.Add(reader.ReadLine()); } } else { throw new Exception("Could not connect to remote server"); } return result; }
Reply
Answers (
0
)
Is there a fast way to convert a bitmap image to a grayscale or binary image?
searching an array of classes