public DataResponse <IntPtr> ShowConsole() { if (!NTMinerConsole.IsEnabled) { NTMinerConsole.Enable(); NTMinerConsole.UserOk("打开控制台窗口"); Console.Title = "开源矿工守护程序"; } IntPtr intPtr = NTMinerConsole.GetOrAlloc(); return(DataResponse <IntPtr> .Ok(intPtr)); }
private static void InitOnece() { if (!_isInited) { lock (_locker) { if (!_isInited) { _isInited = true; NTMinerConsole.GetOrAlloc(); } } } }
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); } }