我如何获得每小时的确切时间? [英] how can i get the exact amount of the time per hour ??

查看:58
本文介绍了我如何获得每小时的确切时间?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我只是编程的新手.

这是我计时器内的代码.

还有其他方法可以计算每小时的金额吗?
如果使用此代码,我将无法获得确切的金额?

你能帮我吗..

I''m just a novice in programming.

This is my code inside the timer.

Is there any other way to compute the amount per hour??
I can''t get the exact amount if I use this code??

Can you help me please..

private void timer_pc2_Tick(object sender, EventArgs e)
       {//to count for the amount per hour
           count_pc2 += 1;
           if (count_pc2 == 1800)
           {
               amount_pc2 += 1;
               lblamount_pc2.Text = "P" + " " + (amount_pc2.ToString()) + ".00";
               count_pc2 = 1640;
           }
           //count time
           diffA[2] = DateTime.Now - startTime[2];
           diffB[2] = new TimeSpan(diffA[2].Hours, diffA[2].Minutes, diffA[2].Seconds);
           this.lbltime_pc2.Text = (diffB[2].ToString());
           if (this.lbltime_pc2.Text == diff[2].ToString())
           {
               this.timer_pc2.Enabled = false;
               endTime[2] = DateTime.Now.AddMinutes(0);
           }
       }

推荐答案

rudzky写道:

还有其他方法吗?关于如何计算每小时的金额?

is there any other way on how to compute the amount per hour??



多少,您的问题不清楚?



Amount of what, your question is not clear?


这篇关于我如何获得每小时的确切时间?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆