How to include two namespaces with same name in a?
I have two n开发者_高级运维amespaces with same name. Can I refer both in same file?
Yes, you can use an alias. See How to: Use the Namespace Alias Qualifier
Two relevant pats:
global::System.Console.WriteLine(number);
This will always work, even if you have other System
or Console
names.
using colAlias = System.Collections;
This lets you declare an alias for a given namespace.
Here is an example
using MyNamespace1 = Namespace1.Test.ClassName;
using MyNamespace2 = Namespace2.Test.ClassName;
精彩评论