本人想制作一个倒计时程序 拖一个timer在timer的-tick事件里写上你的这些需求 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 DateTime.Now获得当前时间DateTime.Parse()将字符串转换为时间TimeSpan.FromTicks(datetime2.Ticks - datetime1.Ticks).TotalSeconds;可以计算时间差 "本人想用C#WINFORM制作一个倒计时程序"你都说是你想写啊.如果我们帮你写完的话就没意思了 using System;using System.Collections.Generic;using System.ComponentModel;using System.Data;using System.Drawing;using System.Text;using System.Windows.Forms;namespace 倒计时{ public partial class Form1 : Form { public Form1() { InitializeComponent(); } private void timer1_Tick(object sender, EventArgs e) { label2.Text = Convert.ToString(DateTime.Now.TimeOfDay).Substring(0, 8); } private void Form1_Load(object sender, EventArgs e) { label2.Text = Convert.ToString(DateTime.Now.TimeOfDay).Substring(0, 8); } private void button1_Click(object sender, EventArgs e) { label3.Text = Convert.ToString(DateTime.Parse(textBox1.Text) - DateTime.Now); } }}大体就是这么个框架,具体你自己看看怎么做了 Asp.net 获取指定目录下的后缀名为“.xls” 的所有文件名和以及该文件下所有sheet名的方法 DataGridView 控件的使用 关于C#反射、程序集的应用的一个问题~~毕业设计/论文~~求各位大侠赐教! 动态加载用户控件如何传递参数 对Aspx页面的body怎么加样式? 不太明白“三层模型”是什么意思。 如何获知MediaPlayer已播放完毕?? 如何向WebBrowser控件中注入想要的Cookie? 这段代码是什么意思? 问一个老问题——主窗体和子窗体的变量传递问题 如何在Panel中画一个圆? 期待中........... 知道日期怎么判断 星期几?
DateTime.Parse()将字符串转换为时间
TimeSpan.FromTicks(datetime2.Ticks - datetime1.Ticks).TotalSeconds;可以计算时间差
你都说是你想写啊.如果我们帮你写完的话就没意思了
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;namespace 倒计时
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
} private void timer1_Tick(object sender, EventArgs e)
{
label2.Text = Convert.ToString(DateTime.Now.TimeOfDay).Substring(0, 8);
} private void Form1_Load(object sender, EventArgs e)
{
label2.Text = Convert.ToString(DateTime.Now.TimeOfDay).Substring(0, 8);
} private void button1_Click(object sender, EventArgs e)
{
label3.Text = Convert.ToString(DateTime.Parse(textBox1.Text) - DateTime.Now);
}
}
}大体就是这么个框架,具体你自己看看怎么做了