473,387 Members | 1,790 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,387 software developers and data experts.

FTP Command List by command prompt in asp.net 1.1 c# code

Any help what is wrong with this code..
I am tring to FTP post a file by command prompt but it not work, system hang up.. commands are in my batch file...

System.Diagnostics.ProcessStartInfo psi = new System.Diagnostics.ProcessStartInfo("cmd.exe");
psi.UseShellExecute = false;
psi.RedirectStandardOutput = true;
psi.RedirectStandardInput = true;
psi.RedirectStandardError = true;
psi.Arguments = "ftp -b Upload.bat gateway.wamnet.com";

System.Diagnostics.Process proc = System.Diagnostics.Process.Start(psi);


System.IO.StreamWriter sIn = proc.StandardInput; // Attach the in for writing
System.IO.StreamReader sOut = proc.StandardOutput; // Attach the output for reading
System.IO.StreamReader sErr = proc.StandardError; // Attach the output for errors

proc.Close();

string results = "";
results = "<br /><b>Output : </b><br />"+sOut.ReadToEnd().Trim();
results = "<br /><b>Error : </b><br />"+sErr.ReadLine().ToString();

// Close the io Streams;
sIn.Close();
sOut.Close();
sErr.Close();
Response.Write(results);
Oct 25 '07 #1
0 1254

Sign in to post your reply or Sign up for a free account.

Similar topics

2
by: Pascal Deparis | last post by:
Hi, I've got a problem with the DB2 Command Line Processor, in V8, FP1. The databases have been created on an AIX server (version 4.3.3). Have a look at this: >db2 ? list DB21034E The...
3
by: John Smith | last post by:
Hello all: I have yet another question to ask the gurus of C#. I am trying to get a list of all the connected computers on our domain. The only way I know how is by going to the command prompt...
4
by: glenn | last post by:
I keep reading all sorts of books on VS that keep telling me to click on Tools/Visual Studio Command prompt to run this program or that program. However, I do not have such a menu choice. Where is...
34
by: Roman Mashak | last post by:
Hello, All! I'm implementing simple CLI (flat model, no tree-style menu etc.). Command line looks like this: <command> <param1> <param2> ... <paramN> (where N=1..4) And idea is pretty simple: ...
9
by: RajW | last post by:
Disclaimer: I'm new to C. I'm building a simple text based program and I'm not sure I'm designing it correctly. What I have is simple and it works but it just seems weird. Is there a better way?...
3
by: Steven | last post by:
I am using VC++ 6.0 to build a windows based application, however, my application allows user to input command arguments in the dos prompt windows. I want to have a warning message for user if they...
4
by: Ronald S. Cook | last post by:
Currently (manually), I 1) open a Windows SDK Command Prompt and 2) navigate to a particular folder. Then I 3) type a command and press enter. The command is irrelevant (WCF-related) but here it...
3
by: kimiraikkonen | last post by:
Hi experts, I just want to ask a simple procedure of my simple form. My form has a input textbox and a button. I want this if you can help me: Application user types a command prompt command...
5
by: waltbrad | last post by:
Hi folks. I'm learning Python from the Mark Lutz Book, Programming Python 3rd edition. He seems to be able to invoke the Python interpreter from any command line prompt. C:\temp>python ...
4
by: bkamrani | last post by:
Hi, This is a basic problem, but I want to print help content in a Command Prompt in WinXP and scrolling back to see the first lines. If I start a command prompt and run python, and then for...
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: 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: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
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,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

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.