首页 > 编程 > C# > 正文

C#定时器的使用

2020-04-09 21:40:36
字体:
来源:转载
供稿:网友

推荐:.NET中加密与解密QueryString的方法
1.加密。Response.Redirect("DetailInfo.aspx?id=" Convert.ToBase64String(System.Text.Encoding.Default.GetBytes("sp10006")).Replace(" ","+"

C#定时器的使用

 

以下为引用的内容:

Timer timer1;
this.timer1.Interval = 1000;
this.timer1.Tick = new System.EventHandler(this.timer1_Tick);

private void timer1_Tick(object sender, EventArgs e)
{
ArrayList AutoTask = new ArrayList();
AutoTask.Add("8:30:00");
AutoTask.Add("9:30:00");
AutoTask.Add("10:30:00");
AutoTask.Add("11:30:00");

for (int n = 0; n < 4; n )
{
if (dtAuto.ToLongTimeString().Equals(AutoTask[n]))
{
MessageBox.Show("现在时间是" AutoTask[n]);
}
}
}

分享:利用.net的强大功能发送email
主要的代码如下: using System.Web.Mail; MailMessage myMail = new MailMessage(); myMail.To = "ast03@mails.tsinghua.edu.cn"; //接受方的电子邮件地址 myMail.From =

 

发表评论 共有条评论
用户名: 密码:
验证码: 匿名发表

图片精选