且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

如何在C#asp.net中显示实时时间(时钟)

更新时间:2023-02-26 17:07:47

hai
第1步:创建一个用于刷新页面的meta标签,该标签紧随其后

第2步:创建一个标签并分配以下方法
Label1.Text = System.DateTime.Now.ToString();
hai
Step 1: create one meta tag for refreshing page, that tag follows

Step 2: Create one label and assign following method
Label1.Text = System.DateTime.Now.ToString();


将标签中的文本设置为当前时间.每秒刷新一次页面.不过,JavaScript是更好的选择.
Set the text in a label to the current time. Refresh the page every second. JavaScript is the better option though.


Chao90写道:

有人知道如何显示实时计时吗? C#语言在asp.net网页上显示(时钟)?

Does anyone know how to display real time timing(clock) on asp.net web page by using C# language?



您可能会问这个事实,这表明您对ASP.NET一无所知,它是什么或做什么.继续使用已有的代码,然后购买一些ASP.NET书籍并阅读.



The fact that you''d ask this, shows you know nothing about ASP.NET, what it is, or what it does. Keep using the code you have, and buy some ASP.NET books and read them.