I need to exicute multiple lines of commands in CMD, how would I do that?
Please look at http://www.codeproject.com/KB/cs/Execute_Command_in_CSharp.aspx
There is also a nice example.
If you know this method and are asking for one with multiple lines you can just add \n and go on as it is a string parser.
To write lines I'd just do stuff like this?
That is after the process is started.
Would it automatically press enter or would I have to use
Edited 7 Years Ago
by GAME: n/a
GAME after some reading I have come up with two methods for this.
Write your Commands in a text file and save it as a .cmd and run that file or do the following.
Process p = new Process();
ProcessStartInfo info = new ProcessStartInfo();
info.FileName = "cmd.exe";
info.RedirectStandardInput = true;
info.UseShellExecute = false;
p.StartInfo = info;
using (StreamWriter sw = new StreamWriter(p.StandardInput))
sw.WriteLine("mysql -u root -p");
I am working creating a fully encapsulated, homogeneous singly linked data structure. The Listing class and SinglyLinkedList class that are part of the whole application compile fine, but the problem ...
I have this block of code where l run through a table and display matched results in a listbox.
It works fine, but my question is how do l enable ...
I have developed a DBMS and I want to store the credentials for server, and user name securely so that the users don't have to enter the password ...