【发布时间】:2011-07-19 19:08:20
【问题描述】:
我的问题是当命令行运行时它不会在我的解密文本文件中添加任何内容。我在decrypt.txt 文件中添加了文本,以查看它是否写入它,因为文本被删除了。
System.Diagnostics.ProcessStartInfo psi =
new System.Diagnostics.ProcessStartInfo("cmd.exe");
psi.CreateNoWindow = true;
psi.UseShellExecute = false;
psi.RedirectStandardInput = true;
psi.RedirectStandardOutput = true;
psi.RedirectStandardError = true;
psi.WorkingDirectory = "c:\\";
System.Diagnostics.Process process = System.Diagnostics.Process.Start(psi);
string sCommandLine = "echo femme toxin sorghum| gpg.exe --batch --passphrase-fd 0 --decrypt E:\\entemp.txt > E:\\detemp.txt";
process.StandardInput.WriteLine(sCommandLine);
process.StandardInput.Flush();
process.StandardInput.Close();
process.WaitForExit();
process.Close();
【问题讨论】:
-
这表面上与 C# 相关,您正在寻求有关 pgp 的帮助,但使用的是 gpg...实际上这是一个 gpg 问题,所以也许超级用户会更合适。
标签: c# pgp encryption openpgp