将datetime.now与给定日期进行比较 [英] compare datetime.now with a given date

查看:250
本文介绍了将datetime.now与给定日期进行比较的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

你好,
我想将给定日期的月份(在文本框中)与datetime.now进行比较,当datetime.now超过给定日期的月份时,可以播放声音.我对此是新手.

谢谢
Kyriakos

Hello,
I would like to compare the month of a given date (in a text box) with datetime.now, when the datetime.now reaches a month beyond the given date to play a sound. I am novice to this.

Thank you
Kyriakos

推荐答案

Dim myDate as DateTime=DateTime.Parse(textbox.Text)
If (DateTime.Now.Month > myDate.Month) Then
    PlaySound()
EndIf



注意:
我建议您也检查年份...



Note:
I suggest you also check the Year...


这篇关于将datetime.now与给定日期进行比较的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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