简体   繁体   中英

Entering a password using System.Diagnostics.Process

I have created a new instance of the System.Diagnostics.Process class.

The StartInfo.Filename property is the name of my command line application ( OpenSSL.exe ). I can use StandardInput.WriteLine to send commands to this application. This works fine until I reach the point where I am asked for a password, in which case StandardInput.WriteLine doesn't do anything.

What am I doing wrong here?

我解决了这个问题,我添加了对System.Windows.Forms的引用,然后使用SendKeys.SendWait将我的密码的每个字母发送到应用程序,然后输入Enter键。

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM