1.在c#文件頭寫using 語句
2.命名空間的別名例子:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Introduction = Gychan.Test;
namespace test
{
class Program
{
static void Main(string[] args)
{
#region namespace
Introduction::StudyExample test = new Introduction.StudyExample();
Console.WriteLine(test.GetNameSpace());
Console.ReadLine();
#endregion
}
}
}
namespace Gychan.Test
{
class StudyExample
{
public string GetNameSpace()
{
return this.GetType().Namespace;
}
}
}