を複数のテキストボックスから値を呼び出し、コマンドライン引数を作成しようとしています:私はこれまでのところ、私はこれを持って
ProcessStartInfo psi = new ProcessStartInfo("cmd");
psi.UseShellExecute = false;
psi.RedirectStandardOutput = true;
psi.CreateNoWindow = true;
psi.RedirectStandardInput = true;
psi.WorkingDirectory = @"C:\";
var proc = Process.Start(psi);
string username = textBox1.Text;
string password = textBox2.Text; //not sure about these 3 lines is correct?
string urladdress = textBox7.Text;
proc.StandardInput
.WriteLine("program.exe URLHERE --username=****** --password=****** --list");
proc.StandardInput.WriteLine("exit");
string s = proc.StandardOutput.ReadToEnd();
richTextBox2.Text = s;
私の問題は、このようなコマンドラインを作成するには、それを得ることです:
program.exe https://website-iam-trying-to-reach.now --username=myusername --password=mypassword --list
そして、何の問題あなたは、このようなプログラムを作成したしているの? – Servy
この行のtextbox1 2または7から値を呼び出す方法がわかりません proc.StandardInput.WriteLine( "program.exe textbox7 --username = textbox1 --password = textbox2 --list"); –
文字列を連結する方法についてどのような研究を行っていますか?どのような情報が見つかりましたか、そしてどのようにして問題を解決できなかったのですか? – Servy