Exemple #1
0
        public Form1(bool ss)
        {
            InitializeComponent();

            if (ss)
            {
                Form4 f4 = new Form4();
                f4.ShowDialog();
            }

            if (Config.ConfigData.DebugConsole)
                Helpers.AllocConsole();

            Helpers.ConsolePrint("Starting up");

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

            Text += " v" + Application.ProductVersion;

            if (Config.ConfigData.Location >= 0 && Config.ConfigData.Location <= 3)
                comboBox1.SelectedIndex = Config.ConfigData.Location;
            else
                comboBox1.SelectedIndex = 0;

            textBox1.Text = Config.ConfigData.BitcoinAddress;
            textBox2.Text = Config.ConfigData.WorkerName;
        }
        public Form1(bool ss)
        {
            InitializeComponent();

            if (ss)
            {
                Form4 f4 = new Form4();
                f4.ShowDialog();
            }

            if (Config.ConfigData.LogLevel > 0)
                Logger.ConfigureWithFile();

            if (Config.ConfigData.DebugConsole)
                Helpers.AllocConsole();

            Helpers.ConsolePrint("NICEHASH", "Starting up");

            // 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;

            if (Config.ConfigData.Location >= 0 && Config.ConfigData.Location < MiningLocation.Length)
                comboBox1.SelectedIndex = Config.ConfigData.Location;
            else
                comboBox1.SelectedIndex = 0;

            textBox1.Text = Config.ConfigData.BitcoinAddress;
            textBox2.Text = Config.ConfigData.WorkerName;
        }