【发布时间】:2012-08-01 18:30:53
【问题描述】:
我正在研究 GPG 加密并希望将文件保存到特定目录...有人可以告诉我如何执行此操作... 我正在使用此代码
ProcessStartInfo startInfo = new ProcessStartInfo()
{
WorkingDirectory = @"C:\",
CreateNoWindow = false,
UseShellExecute = false,
RedirectStandardError = true,
RedirectStandardInput = true,
RedirectStandardOutput = true
};
startInfo.FileName = "gpg.exe";
startInfo.WindowStyle = ProcessWindowStyle.Hidden;
startInfo.Arguments = "-e -r myname config.xml";
using (Process exeProcess = Process.Start(startInfo))
{
exeProcess.WaitForExit();
}
当我这样做时,它会将其保存到 APPdata 文件夹中,有没有办法可以将其更改为某个默认文件夹?
我是否必须设置一些环境变量才能做到这一点?
请帮助我。如果我不清楚或者我错过了一些非常愚蠢的东西,请告诉我!
提前致谢
【问题讨论】:
-
你不能简单地在输出名称前加上路径吗?
-
config.xml 不是源文件的输出名称。你能帮我把最终的加密文件保存到特定目录吗?
-
您是否阅读了命令行上的帮助? gnupg.org/documentation/manuals/gnupg/…
-
我试过 @Erno 但它不能与加密一起工作!
-
您是否添加了足够的引号以便正确处理路径中的空格?