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.
Jan MontanoPosted Jun 20, 2007, 11:43 PM