public void GPG()
{
string password = "1234567890";

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 = @"D:\sofe\GnuPG";
System.Diagnostics.Process process = System.Diagnostics.Process.Start(psi);

//解密
string sCommandLine = @"gpg --passphrase 1234567890 --output C:\Users\LWP\Desktop\cc.txt --decrypt C:\Users\LWP\Desktop\cc.txt.gpg";

//加密
//string sCommandLine = @"gpg -r liwenping -e C:\Users\LWP\Desktop\cc.txt";

process.StandardInput.WriteLine(sCommandLine);

process.StandardInput.Flush();
process.StandardInput.Close();

process.WaitForExit();

string result = process.StandardOutput.ReadToEnd();
string error = process.StandardError.ReadToEnd();
process.Close();
process.Dispose();
}

//使用前先安装好GPG

//注 本人密钥和私钥尚未上传过,请另行注册

//参考  http://blog.csdn.net/puppylpg/article/details/50901779

最新文章

  1. JSON字符串与JSON对象的区别
  2. Cordova - 使用Cordova开发iOS应用实战1(配置、开发第一个应用)
  3. bzoj1787
  4. sql事务和锁
  5. 带你熟悉CSS浮动
  6. Android图片浏览器之图片删除
  7. Codeforces548D:Mike and Feet(单调栈)
  8. XHTML
  9. webService请求方式快速生成代码 (Postman)
  10. C++ 函数对象
  11. 【mysql】mysql主从复制
  12. Odoo Linux服务器一键安装脚本使用指南
  13. 如何实现从Java入门到服务端项目开发的进阶?
  14. Linux常见企业面试题
  15. /var/run/yum.pid 已被锁定,PID 为 2925 的另一个程序正在运行
  16. django rest_framework 分页出现报错
  17. Delphi.XE2破解方法
  18. 使用pycharm开发代码上传到GitLab和GitHub
  19. E: could not get lock /var/lib/dpkg/lock-frontend - open (11: Resource temporary unavailable) E: Unable to acquire the dpkg frontend lock (/var/lib/dpkg/lock-frontend), is an other process using it
  20. CentOS 7 隐藏任务栏和顶栏

热门文章

  1. ubuntu中不能远程连接解决
  2. Selenium键盘鼠标操作总结
  3. .NET CORE MVC网站体验
  4. mysql case when then 使用
  5. NGUI 使用Grid自动排列UI
  6. day09-3 数据类型总结,深浅拷贝
  7. HDU1231 最长连续子序列
  8. node——post提交新闻内容
  9. Day 07 数据类型的内置方法[列表,元组,字典,集合]
  10. (4)pyspark---dataframe清理