我正在使用命令行来加密我发送的文件,但我正在尝试弄清楚如何使用相同的方法来解密它们。如果我运行命令,系统会提示输入密码,但我看不到使用命令行传递密码的方法。这是我加密文件的方式:
var proc = new Process();
proc.EnableRaisingEvents = false;
proc.StartInfo.WorkingDirectory = "C:\\";
proc.StartInfo.FileName = @"C:\Progra~1\GNU\GnuPG\gpg.exe";
proc.StartInfo.Arguments = @"-e -u ""user1@example.com"" -r ""user2@example.com"" ""C:\file.csc""";
proc.Start();
proc.WaitForExit();
** 这是用于我的解决方案的有用链接: http://social.msdn.microsoft.com/Forums/en-US/csharpgeneral/thread/38c21304-fc7a-42cc-a5fb-dcb6da7f6411/
最佳答案
属性(property)Process.StandardInput应该给你一个 StreamWriter,你可以用它来提供标准输入的密码。
关于c# - 命令行 GPG 使用 c# 解密 - 密码?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/4069919/