0

I am trying to encrypt using gpg but i get this error even though i have given the path explicitly.. can some one help me? I am using Starksoft.Cryptography.OpenPGP. I have installed the gpg4win-light-2.1.0.exe to obtain the gpg.exe file..

is there something i am missing?

Error:GPG executable not found. @C:\Program Files\GNU\GnuPG\gpg.exe\gpg2.exe.

        GnuPG gpg = new GnuPG();
        gpg.BinaryPath = "@C:\\Program Files\\GNU\\GnuPG\\gpg.exe";
        gpg.Recipient = "myfriend@domain.com";
        FileStream sourceFile = new FileStream(sourcePath, FileMode.Open);
        FileStream outputFile = new FileStream(Destinationpath, FileMode.Create);
        gpg.Encrypt(sourceFile,outputFile);
        sourceFile.Close();
        outputFile.Close();

I even have a licence for openBlackboxPGP.. can i encrypt using gpg using that??

Please help me if i am missing something! Thanks in advance!

4

1 回答 1

0

我想你是想说

gpg.BinaryPath = @"C:\Program Files\GNU\GnuPG\gpg.exe";

(注意 的位置@),或

gpg.BinaryPath = "C:\\Program Files\\GNU\\GnuPG\\gpg.exe";

尽管您最好使用更具可读性的形式

gpg.BinaryPath = "C:/Program Files/GNU/GnuPG/gpg.exe";
于 2012-07-31T20:39:06.150 回答