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
Jonathan Ownbey
NA
2
0
C# app ftp process whitespace problem
Jun 20 2007 10:08 PM
I have an app that creates batch files for an ftp process and uses the absolute path as the download location. This creates an error when executed because the path has whitespaces included. Any help is appreciated.
Code follows:
using
(
StreamWriter
sw = TextFile.CreateText())
{
sw.WriteLine(
"open "
+ ftpIpAddress);
sw.WriteLine(
"user"
);
sw.WriteLine(ftpLogin);
sw.WriteLine(ftpPassword);
sw.WriteLine(
"lcd "
+ DirInfo.FullName);
sw.WriteLine(
"mget pVQI"
+ date.ToString(
"MMdd"
) +
"*.zip"
);
sw.WriteLine(
"pause"
);
sw.WriteLine(
"quit"
);
sw.Close();
}
ProcessStartInfo
psi =
new
ProcessStartInfo
(BatFile.FullName);
psi.RedirectStandardOutput =
false
;
psi.WindowStyle =
ProcessWindowStyle
.Minimized;
psi.UseShellExecute =
false
;
Process
ftp =
Process
.Start(psi);
StreamReader
output = ftp.StandardOutput;
ftp.WaitForExit
();
if
(ftp.HasExited)
{
rtbOutput.AppendText(
"FTP process ended.\n"
);
string
line;
while
(!output.EndOfStream)
{
line = output.ReadLine();
rtbOutput.AppendText(line +
"\n"
);
}
These are just snippets, fyi.
Reply
Answers (
1
)
Help! Error " you are trying to read or write into protected memory"
validate Integers.....