【发布时间】:2014-02-07 10:36:23
【问题描述】:
有一个烦人的问题,虽然我已经构建了一个类并在客户端程序中引用它,如下所示 - 使用 using,编译器需要我的方法的完全限定名称。
// 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");
}
}
}
【问题讨论】:
标签: c# class namespaces naming fully-qualified-naming