예제 #1
0
        public Form_Main()
        {
            InitializeComponent();
            this.Icon = NiceHashMiner.Properties.Resources.logo;

            InitLocalization();

            ComputeDeviceManager.SystemSpecs.QueryAndLog();

            // Log the computer's amount of Total RAM and Page File Size
            ManagementObjectCollection moc = new ManagementObjectSearcher("root\\CIMV2", "SELECT * FROM Win32_OperatingSystem").Get();

            foreach (ManagementObject mo in moc)
            {
                long TotalRam     = long.Parse(mo["TotalVisibleMemorySize"].ToString()) / 1024;
                long PageFileSize = (long.Parse(mo["TotalVirtualMemorySize"].ToString()) / 1024) - TotalRam;
                Helpers.ConsolePrint("NICEHASH", "Total RAM: " + TotalRam + "MB");
                Helpers.ConsolePrint("NICEHASH", "Page File Size: " + PageFileSize + "MB");
            }

            R = new Random((int)DateTime.Now.Ticks);

            Text += " v" + Application.ProductVersion + _betaAlphaPostfixString;

            label_NotProfitable.Visible = false;

            InitMainConfigGUIData();

            // for resizing
            InitFlowPanelStart();

            if (groupBox1.Size.Height > 0 && this.Size.Height > 0)
            {
                EmtpyGroupPanelHeight = groupBox1.Size.Height;
                MainFormHeight        = this.Size.Height - EmtpyGroupPanelHeight;
            }
            else
            {
                EmtpyGroupPanelHeight = 59;
                MainFormHeight        = 330 - EmtpyGroupPanelHeight;
            }
            ClearRatesALL();

            SettingsUtil.Init();
            SettingsUtil.LoadSettings();
        }