到目前爲止,我有這樣的:我想打電話從多個文本框的值,並創建一個命令行參數
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