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
Archana Patil
NA
43
86.3k
Read file using FTP
Apr 10 2012 2:42 AM
Hi,
My code is
FtpWebRequest strRequest = (FtpWebRequest)WebRequest.Create(myUrl);
strRequest.Credentials = new NetworkCredential(username,PWD);
strRequest.UsePassive = true;
strRequest.UseBinary = true;
strRequest.KeepAlive = true;
FtpWebResponse Response = (FtpWebResponse)strRequest.GetResponse();
Stream ResponseStream = Response.GetResponseStream();
StreamReader Reader = new StreamReader(ResponseStream);
string strt = "";
string str = null;
while ((str = Reader.ReadLine()) != null)
{
string[] str1 = str.Split('|');
string dts = str1[6].ToString();
dts = dts.Substring(0, str1[6].Length - 9);
string tm = str1[6].ToString();
tm = tm.Substring(11);
strt = str1[0] + "," + str1[1] + "," + str1[2] + "," + str1[3] + "," + str1[4] + "," + str1[5] + "," + dts + "," + tm + "," + str1[7] + "," + str1[8] + "," + str1[9] + "," + str1[10] + "," + str1[11] + "," + str1[12];
TestMethod(strt);
}
Response.Close();
ResponseStream.Close();
Reader.Close();
When i run this code locally its working properly but when i put it on live
I am getting error "
The remote server returned an error: 227 Entering Passive Mode (203,197,64,8,16,33). .
". in reading CSV file from server.I am using .net 4.0
please help
Thanks,
Archana
Reply
Answers (
1
)
Issue in Batch execution at Server side
problem with webform design