コード例 #1
0
        private void tick_timer_Tick(object sender, EventArgs e)
        {
            int cpu = per.get_all_cpu();
            int mem = per.get_use_mem();

            cpu_lab.Text     = string.Format("{0}%", cpu);
            mem_use_lab.Text = string.Format("{0}MB", mem);

            if (conection)
            {
                string sendstr;
                //tcp.send(sendstr);
                //System.Console.WriteLine("send:{0}",sendstr);

                sendstr = string.Format("{0},{1}", mem, cpu);
                for (int i = 0; i < per.cpu_count(); i++)
                {
                    string str = string.Format(",{0}", per.get_thread_cpu(i));
                    sendstr += str;
                }

                tcp.send(sendstr);
                System.Console.WriteLine("send:{0}", sendstr);
            }
        }
コード例 #2
0
        //イベント
        public CPU_Count_lab()
        {
            InitializeComponent();
            per = new performance();

            port_box.Text = "1000";
            conection     = false;

            cpu_lab.Text     = string.Format("{0}%", per.get_all_cpu());
            mem_max_lab.Text = string.Format("{0}MB", per.max_mem());
            mem_use_lab.Text = string.Format("{0}MB", per.get_use_mem());

            tick_timer.Enabled = true;
        }
コード例 #3
0
        //イベント
        public CPU_Count_lab()
        {
            InitializeComponent();
            per = new performance();

            port_box.Text = "1000";
            conection = false;

            cpu_lab.Text = string.Format("{0}%", per.get_all_cpu());
            mem_max_lab.Text = string.Format("{0}MB", per.max_mem());
            mem_use_lab.Text = string.Format("{0}MB", per.get_use_mem());

            tick_timer.Enabled = true;
        }