【发布时间】:2009-06-22 17:34:51
【问题描述】:
我收到编译错误,因为编译器认为 Path.Combine 引用了我的字段,但我希望它引用 System.IO.Path 类。除了总是必须像 System.IO.Path.Combine() 这样编写 FQN 之外,还有什么好的方法来处理这个问题吗?
using System.IO;
class Foo
{
public string Path;
void Bar(){ Path.Combine("",""); } // compile error here
}
【问题讨论】:
标签: c# properties namespaces syntax-error collision