1

有一个烦人的问题,虽然我已经构建了一个类并在下面的客户端程序中引用了它 - 使用时,编译器想要我的方法的完全限定名称。

// this doesn't compile because it does not recognize the Decrypt method
using PGPEncryptDecrypt.Helpers.PGP;

namespace TestComInterOpPGP
{
class Program
{
    static void Main(string[] args)
    {
         PGPEncryptDecrypt.Decrypt(@"C:\Users\blah.pgp",
            @"C:\Users\secring.gpg",
            "pwd",
            @"C:\Users\out.txt");

    }
}
}

必须完全符合条件

// this does compile
using PGPEncryptDecrypt.Helpers.PGP;

namespace TestComInterOpPGP
{
class Program
{
    static void Main(string[] args)
    {
         PGPEncryptDecrypt.Helpers.PGP.PGPEncryptDecrypt.Decrypt(@"C:\Users\blah.pgp",
            @"C:\Users\secring.gpg",
            "pwd",
            @"C:\Users\out.txt");

    }
}
}
4

1 回答 1

2

啊-在键入此内容时,我意识到问题在于 PGPEncryptDecrypt 类与名称空间的第一部分具有相同的名称。所以我只是改变了一个或另一个,不需要完全符合条件。也许这会帮助某人!

于 2014-01-17T22:21:00.557 回答