你可以使用一个TImer监控本地时间,被修改的话计算一下时间差就知道了。
你可以那网络时间与本地时间相减得到时间差,以后都按本地时间算差值。
你可以那网络时间与本地时间相减得到时间差,以后都按本地时间算差值。
解决方案 »
- 自定义控件下的ToolTip使用
- winform内容滚动的问题
- 数据建模用哪个工具好?建模的方法谁能讲一讲?
- c# 删除INTERNET临时文件问题
- 急得一身汗了,都看不到问题在哪里啊!各位帮帮我吧~
- 帮帮忙:ExecuteNonQuery 要求已打开且可用的连接。连接的当前状态为已关闭
- 如何循环为Label赋值?在线等!急~~
- 关于OracleClient中处理CLOB的问题(C#)
- 取repeater里边绑定的textbox的值
- 如何知道打开了多少个QQ或QQ群组(打开的组在任务栏都会有停靠,以任务栏为准)聊天窗口?
- C# 委托多窗体操作传值问题
- <input type="file" >上传二进制图片的事例,在VS2003下 C#
尤其服务器上有数据库的话,通过SQL语句查询数据库时间是很简单的工作,而且也不产生对外流量
#region Windows 窗体设计器生成的代码 /// <summary>
/// 设计器支持所需的方法 - 不要
/// 使用代码编辑器修改此方法的内容。
/// </summary>
private void InitializeComponent()
{
this.groupBox1 = new System.Windows.Forms.GroupBox();
this.txt_Time = new System.Windows.Forms.TextBox();
this.groupBox1.SuspendLayout();
this.SuspendLayout();
//
// groupBox1
//
this.groupBox1.Controls.Add(this.txt_Time);
this.groupBox1.Location = new System.Drawing.Point(6, 8);
this.groupBox1.Name = "groupBox1";
this.groupBox1.Size = new System.Drawing.Size(373, 74);
this.groupBox1.TabIndex = 0;
this.groupBox1.TabStop = false;
this.groupBox1.Text = "每秒种获取一次系统时间并显示";
//
// txt_Time
//
this.txt_Time.Font = new System.Drawing.Font("宋体", 24F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.txt_Time.ForeColor = System.Drawing.Color.Maroon;
this.txt_Time.Location = new System.Drawing.Point(6, 20);
this.txt_Time.Name = "txt_Time";
this.txt_Time.Size = new System.Drawing.Size(360, 44);
this.txt_Time.TabIndex = 0;
//
// Frm_Main
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(384, 85);
this.Controls.Add(this.groupBox1);
this.Name = "Frm_Main";
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
this.Text = "使用Sleep方法延迟时间";
this.Load += new System.EventHandler(this.Frm_Main_Load);
this.groupBox1.ResumeLayout(false);
this.groupBox1.PerformLayout();
this.ResumeLayout(false); }