[HELP] truyền commands từ Form qua một cmd application

Chào mọi người, hiện tại thì em đang viết một tool giúp tự động hóa việc add user vào vpn server và sử dụng SoftEther Vpncmd em đã send được các commands lúc đầu nhưng tới lúc gửi password từ textbox sang bên vpncmd thì nó lại không nhận được :smile:


tới chỗ password thì nó cứ đứng y như thế :smile:.

-Đây là code gửi commands của em ạ:

   public void runVPNCMD(string UN, string PW, string date)
        {
            string commands = string.Format("UserCreate {0} /GROUP:none /REALNAME:none /NOTE:{1} /PASSWORD {2}", UN, date, PW);
            try
            {
                using (Process process = new Process())
                {
                    process.StartInfo = new ProcessStartInfo(getRegistryValue(@"SOFTWARE\SoftEther Project\VPN Command Line Utility", "InstalledPath"))
                    {
                        RedirectStandardInput = true,
                        UseShellExecute = false,
                        WorkingDirectory = getSofEtherFolder(),
                        RedirectStandardError = true,
                        //RedirectStandardOutput = true,
                    };

                    //Start process
                    process.Start();
                    //Send command to its input
                    process.StandardInput.WriteLine("1");
                    process.StandardInput.WriteLine(string.Format("{0}:5555", txtIP.Text));
                    if(txtHubName.Text == string.Empty)
                    {
                        process.StandardInput.WriteLine();
                    }
                    process.StandardInput.WriteLine(txtPW);
                }
            }
            catch(Exception e)
            {
                MessageBox.Show(e.Data.ToString());
            }
        }

:smiley: mong mọi người giúp đỡ, em cảm ơn trước.

83% thành viên diễn đàn không hỏi bài tập, còn bạn thì sao?