Exemplo n.º 1
0
        public void getMinerInfo()
        {
            BUSID    = new List <string>();
            Hashrate = new List <string>();
            Accepted = new List <string>();
            Rejected = new List <string>();
            string json = getHtml("http://127.0.0.1:22333/api/v1/status");

            try
            {
                nbminer nbminerInfo = JsonConvert.DeserializeObject <nbminer>(json);
                for (int gpuCount = 0; gpuCount < nbminerInfo.miner.devices.Count; gpuCount++)
                {
                    BUSID.Add(nbminerInfo.miner.devices[gpuCount].pci_bus_id.ToString());
                    Hashrate.Add(nbminerInfo.miner.devices[gpuCount].hashrate.Trim());
                    Accepted.Add(nbminerInfo.miner.devices[gpuCount].accepted_shares.ToString());
                    Rejected.Add(nbminerInfo.miner.devices[gpuCount].rejected_shares.ToString());
                }
            }
            catch (Exception ex)
            {
                StreamWriter streamWriter = File.CreateText("log.txt");
                streamWriter.WriteLine(ex.ToString());
                streamWriter.Flush();
                streamWriter.Close();
            }
        }
Exemplo n.º 2
0
        public void getMinerInfo()
        {
            test     = "wzb";
            BUSID    = new List <string>();
            Hashrate = new List <string>();
            Accepted = new List <string>();
            Rejected = new List <string>();
            string  json        = getHtml("http://127.0.0.1:22333/api/v1/status");
            nbminer nbminerInfo = JsonConvert.DeserializeObject <nbminer>(json);

            for (int gpuCount = 0; gpuCount < nbminerInfo.miner.devices.Count; gpuCount++)
            {
                BUSID.Add(nbminerInfo.miner.devices[gpuCount].pci_bus_id.ToString());
                Hashrate.Add(nbminerInfo.miner.devices[gpuCount].hashrate.Trim() + "H/S");
                Accepted.Add(nbminerInfo.miner.devices[gpuCount].accepted_shares.ToString());
                Rejected.Add(nbminerInfo.miner.devices[gpuCount].rejected_shares.ToString());
            }
        }