计时器值错误 [英] Error In Timer Values

查看:114
本文介绍了计时器值错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,

在我的项目中,我节省了y表单已打开的时间,因此我将表单的打开时间和关闭时间用于将它们组合为字符串变量,但是当我减去关闭时间和打开时间时,它会显示一个错误.

我在向减法值声明字符串varibale,但是它显示出这样的错误:

Hi all,

In my project I am saving the time on how long y form has been open, so I am taking my form''s open time and close time and assinging them into string variables but when I am subtracting close time and open time its showing an error.

I am assinging that subtraction value also string varibale but its showing error like this:

Conversion from string "9:02:53 PM" to type ''Double'' is not valid.


这是我遇到的错误.


This is the error I am getting.

推荐答案

您需要使用TimeSpan 对象进行时差计算.请参见此处 [
You need to use a TimeSpan object to do a time difference calculation. See here[^] for examples.


这篇关于计时器值错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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