예제 #1
0
        public DataResponse <IntPtr> ShowConsole()
        {
            if (!NTMinerConsole.IsEnabled)
            {
                NTMinerConsole.Enable();
                NTMinerConsole.UserOk("打开控制台窗口");
                Console.Title = "开源矿工守护程序";
            }
            IntPtr intPtr = NTMinerConsole.GetOrAlloc();

            return(DataResponse <IntPtr> .Ok(intPtr));
        }
예제 #2
0
 private static void InitOnece()
 {
     if (!_isInited)
     {
         lock (_locker) {
             if (!_isInited)
             {
                 _isInited = true;
                 NTMinerConsole.GetOrAlloc();
             }
         }
     }
 }
예제 #3
0
 static void Main(string[] args)
 {
     if (args.Length != 0)
     {
         if (args.Contains("--sha1", StringComparer.OrdinalIgnoreCase))
         {
             File.WriteAllText(Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "sha1"), Sha1);
             return;
         }
         else if (args.Contains("--ExtractCosturaCompressedDlls", StringComparer.OrdinalIgnoreCase))
         {
             CosturaUtil.ExtractCosturaCompressedDlls();
             return;
         }
     }
     try {
         NTMinerConsole.MainUiOk();
         if (DevMode.IsDevMode)
         {
             NTMinerConsole.GetOrAlloc();
         }
         SystemEvents.SessionEnding += SessionEndingEventHandler;
         StartTimer();
         _waitHandle = new AutoResetEvent(false);
         bool mutexCreated;
         try {
             _sMutexApp = new Mutex(true, "NTMinerNoDevFeeAppMutex", out mutexCreated);
         }
         catch {
             mutexCreated = false;
         }
         if (mutexCreated)
         {
             if (!DevMode.IsDevMode)
             {
                 NTMinerConsole.Disable();
             }
             NTMinerRegistry.SetNoDevFeeVersion(Sha1);
             NTMinerRegistry.SetAutoBoot("NTMinerNoDevFee", true);
             Run();
         }
     }
     catch (Exception e) {
         Logger.ErrorDebugLine(e);
     }
 }