如何开发OS日期时间等桌面应用程序 [英] How To Develop Desktop Application like OS Date Time

查看:65
本文介绍了如何开发OS日期时间等桌面应用程序的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

嘿所有人



我想开发像操作系统时钟这样的应用程序。即如果系统关闭我的时钟将获得正确的时间。



谢谢

Vishal Jodh

Hey Everyone

I want to develop application like Operating System Clock. ie if System is shut down my Clock will be getting correct Time.

Thanks
Vishal Jodh

推荐答案

只需拿一个标签,然后简单地写下这段代码:

Just take a label and simply write this code :
private void timer1_Tick(object sender, EventArgs e)
        {
            Label1.Text = DateTime.Now.ToString();
        }


DateTime.Now.TOshortTimeString()



将给出当前时间

现在只是在标签上打印方法的输出

用于测试这个粘贴你的exe在windows启动文件夹中所以每当计算机启动exe将是开始并将显示你的时间


will give the current time
now just on label print the output from method
for testing this paste your exe in windows startup folder so whenever computer started exe will be start and will show u timing


这篇关于如何开发OS日期时间等桌面应用程序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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