コード例 #1
0
ファイル: TestRandoPort.cs プロジェクト: ewin66/Lxsh.Project
 static TestRandoPort()
 {
     if (_instance == null)
     {
         lock (objLock)
         {
             if (_instance == null)
             {
                 _instance = new TestRandoPort();
             }
         }
     }
 }
コード例 #2
0
ファイル: Program.cs プロジェクト: ewin66/Lxsh.Project
        private static void TestType()
        {
            string TypenName = System.Reflection.MethodBase.GetCurrentMethod().ReflectedType.FullName;

            TypenName = System.Reflection.MethodBase.GetCurrentMethod().Name;

            Type type = typeof(Program);

            Console.WriteLine(TypenName);

            TestRandoPort obj = Activator.CreateInstance(typeof(TestRandoPort)) as TestRandoPort;

            Console.WriteLine(obj.PortIsUsed().Count);
        }