日期:2014-05-18 浏览次数:21208 次
using MyStringArray = System.Collections.Generic.List<string>;
------解决方案--------------------
// cs_using_directive2.cs // Using directive. using System; // Using alias for a class. using AliasToMyClass = NameSpace1.MyClass; namespace NameSpace1 { public class MyClass { public override string ToString() { return "You are in NameSpace1.MyClass"; } } } namespace NameSpace2 { class MyClass { } } namespace NameSpace3 { // Using directive: using NameSpace1; // Using directive: using NameSpace2; class MainClass { static void Main() { AliasToMyClass somevar = new AliasToMyClass(); Console.WriteLine(somevar); } } }
------解决方案--------------------
好像不行呀,一定得用using!