数字文本到语音闹钟 [英] Digital text to speech alarm clock

查看:112
本文介绍了数字文本到语音闹钟的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

请帮助我,我是c新手中的Windows应用程序。

现在我创建一个说闹钟的文本我的代码是



please help me i am new to windows application in c#
Now i am create a text to speak alarm clock my code is
:

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace _2TryAlarmClock
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
DateTime alarmtime;
private void timer1_Tick(object sender, EventArgs e)
{
label3.Text = DateTime.Now.ToLongTimeString();
if(label3.Text.Equals(alarmtime.ToString("HH:mm:ss")))
{
MessageBox.Show("Correct");
}
else
{
MessageBox.Show("Un-Correct");
}

}
private void Form1_Load(object sender, EventArgs e)
{

}

private void alarmon()
{
DateTime dt = DateTime.Now;
int hour = Convert.ToInt32(comboBox1.Text);
int min = Convert.ToInt32(comboBox2.Text);
int sec = Convert.ToInt32(comboBox3.Text);
alarmtime = new DateTime(dt.Year, dt.Month, dt.Day,hour, min, sec);
timer1.Enabled = true;
}
private void cloudStartMenuButton1_Click(object sender, EventArgs e)
{
alarmon();
}

}
}



但我的计时器勾选事件,如果条件总是转到其他部分...... ....

请有人告诉我一个解决方案


but my timer tick event if condition is always go to else part .......
please anyone tell me a solution

推荐答案

调试您的应用程序怎么样?在这种情况下,调试器确实是找出程序行为中出错的最佳工具。

顺便问一下,为什么要比较使用不同格式化选项获得的两个字符串?
What about debugging your application? In such cases, the debugger is really the best tool for finding out what's wrong in the program behaviour.
By the way, why are you comparing two strings obtained using different formatting options?


这篇关于数字文本到语音闹钟的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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