Install windows clock in Asp.net C #

I need to install a Windows clock on my Asp.net website (written in C #)

I found a solution in stackoverflow at:

How to set Windows system clock at the correct local time using C #?

But when I use this, I provide an exception:

Required privilege not held by client

My application survey Identification: Local system

+6
source share
2 answers

itโ€™s not a question โ€œI need the exact C # function for my problemโ€, itโ€™s wrong. This is a security issue. Interfering with a watch is bad. In any case, to solve this problem, you can try to run the application pool under the user account in the Administrators group and disable UAC.

You cannot change the clock on remote clients.

... also do not run antivirus!

Oh, and turn off the synchronization synchronization of your system settings.

0
source
< div class="dp-highlighter"><div class="bar"><div class="tools">view plaincopy to clipboardprint?</div><div class="columns"><div>ยทยทยทยทยทยทยทยทยท10ยทยทยทยทยทยทยทยท20ยทยทยทยทยทยทยทยท30ยทยทยทยทยทยทยทยท40ยทยทยทยทยทยทยทยท50ยทยทยทยทยทยทยทยท60ยทยทยทยทยทยทยทยท70ยทยทยทยทยทยทยทยท80ยทยทยทยทยทยทยทยท90ยทยทยทยทยทยทยทยท100ยทยทยทยทยทยทยท110ยทยทยทยทยทยทยท120ยทยทยทยทยทยทยท130ยทยทยทยทยทยทยท140ยทยทยทยทยทยทยท150</div></div></div> protected void Page_Load(object sender, EventArgs e) { lblTime.Text = DateTime.Now.ToString("hh:mm:ss"); } protected void TimerTime_Tick(object sender, EventArgs e) { lblTime.Text = DateTime.Now.ToString("hh:mm:ss"); } <asp:ScriptManager ID="ScriptManager1" runat="server"> </asp:ScriptManager> <asp:Timer ID="TimerTime" runat="server" Interval="1000"> </asp:Timer> <asp:UpdatePanel ID="UpdatePanel1" runat="server"> <ContentTemplate> <asp:Label ID="lblDateToday" runat="server"></asp:Label> <asp:Label ID="lblTime" runat="server"></asp:Label> </ContentTemplate> <Triggers> <asp:AsyncPostBackTrigger ControlID="TimerTime" EventName="Tick" /> </Triggers> </asp:UpdatePanel> </div> <br /> </div> protected void Page_Load(object sender, EventArgs e) { lblTime.Text = DateTime.Now.ToString("hh:mm:ss"); } protected void TimerTime_Tick(object sender, EventArgs e) { lblTime.Text = DateTime.Now.ToString("hh:mm:ss"); } <asp:ScriptManager ID="ScriptManager1" runat="server"> </asp:ScriptManager> <asp:Timer ID="TimerTime" runat="server" Interval="1000"> </asp:Timer> <asp:UpdatePanel ID="UpdatePanel1" runat="server"> <ContentTemplate> <asp:Label ID="lblDateToday" runat="server"></asp:Label> <asp:Label ID="lblTime" runat="server"></asp:Label> </ContentTemplate> <Triggers> <asp:AsyncPostBackTrigger ControlID="TimerTime" EventName="Tick" /> </Triggers> </asp:UpdatePanel> </div> <br /> 

check http://forums.asp.net/t/1528616.aspx?How+to+diplay+real+time+timing+clock+on+asp+net+web+page https://msdn.microsoft.com/ en-us / library / ms172517 (v = vs. 90) .aspx

0
source

All Articles