怎样 根据特定时间 访问服务器? 【在线等。。。。】 现在正做一个 C/S 的自动更新, 需要接收 用户设定的时间 访问服务器。 这一步怎么来实现呢? 大虾给与帮助。。 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 using System;using System.Collections.Generic;using System.ComponentModel;using System.Data;using System.Drawing;using System.Text;using System.Windows.Forms;namespace WindowsApplication1{ public class DEMO : Form { /// <summary> /// 必需的设计器变量。 /// </summary> private System.ComponentModel.IContainer components = null; /// <summary> /// 清理所有正在使用的资源。 /// </summary> /// <param name="disposing">如果应释放托管资源,为 true;否则为 false。</param> protected override void Dispose(bool disposing) { if (disposing && (components != null)) { components.Dispose(); } base.Dispose(disposing); } #region Windows 窗体设计器生成的代码 /// <summary>使用代码编辑器修改此方法的内容。 /// </summary> private void InitializeComponent() { this.components = new System.ComponentModel.Container(); this.timer1 = new System.Windows.Forms.Timer(this.components); this.label1 = new System.Windows.Forms.Label(); this.dateTimePicker1 = new System.Windows.Forms.DateTimePicker(); this.SuspendLayout(); // // timer1 // this.timer1.Enabled = true; this.timer1.Interval = 1000; this.timer1.Tick += new System.EventHandler(this.timer1_Tick); // // label1 // this.label1.AutoSize = true; this.label1.Location = new System.Drawing.Point(0, 5); this.label1.Name = "label1"; this.label1.Size = new System.Drawing.Size(59, 12); this.label1.TabIndex = 0; this.label1.Text = "更新日期:"; // // dateTimePicker1 // this.dateTimePicker1.CustomFormat = "yyyy年MM月dd日 HH:mm:ss"; this.dateTimePicker1.Format = System.Windows.Forms.DateTimePickerFormat.Custom; this.dateTimePicker1.Location = new System.Drawing.Point(62, 0); this.dateTimePicker1.Name = "dateTimePicker1"; this.dateTimePicker1.Size = new System.Drawing.Size(160, 21); this.dateTimePicker1.TabIndex = 1; this.dateTimePicker1.Value = new System.DateTime(2008, 3, 7, 12, 0, 0, 0); // // Form1 // this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; this.ClientSize = new System.Drawing.Size(222, 21); this.Controls.Add(this.dateTimePicker1); this.Controls.Add(this.label1); this.Name = "Form1"; this.Text = "示例."; this.ResumeLayout(false); this.PerformLayout(); } #endregion private System.Windows.Forms.Timer timer1; private System.Windows.Forms.Label label1; private System.Windows.Forms.DateTimePicker dateTimePicker1; public DEMO() { InitializeComponent(); } private void timer1_Tick(object sender, EventArgs e) { if (DateTime.Now.CompareTo(this.dateTimePicker1.Value) >= 0) { MessageBox.Show("执行自动更新"); } } }} 实际上你可将 Timer.Interval 的值设大一点(节省资源)... 高分求解WPF的datagrid 绑定XML Winform窗口关闭 如何将rar,iso,zip,各种格式的视频文件存入Oracle数据库中? 鼠标右击问题 WPF中使用WebBrowser控件时,窗口设置AllowsTransparency会有问题 菜鸟问题,给分有人帮助吗 请问哪里有WPF的讨论版块啊 c#双线程求指导! 求一正则替换 表达式 TreeView 在每个NODE上传递一个隐含值啊 [我不是要盗版]Reflector报#GUID heap has invalid size 大哥们,如何将我自己建的datatable添加到数据库的表中?
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;namespace WindowsApplication1
{ public class DEMO : Form
{
/// <summary>
/// 必需的设计器变量。
/// </summary>
private System.ComponentModel.IContainer components = null; /// <summary>
/// 清理所有正在使用的资源。
/// </summary>
/// <param name="disposing">如果应释放托管资源,为 true;否则为 false。</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
} #region Windows 窗体设计器生成的代码 /// <summary>使用代码编辑器修改此方法的内容。
/// </summary>
private void InitializeComponent()
{
this.components = new System.ComponentModel.Container();
this.timer1 = new System.Windows.Forms.Timer(this.components);
this.label1 = new System.Windows.Forms.Label();
this.dateTimePicker1 = new System.Windows.Forms.DateTimePicker();
this.SuspendLayout();
//
// timer1
//
this.timer1.Enabled = true;
this.timer1.Interval = 1000;
this.timer1.Tick += new System.EventHandler(this.timer1_Tick);
//
// label1
//
this.label1.AutoSize = true;
this.label1.Location = new System.Drawing.Point(0, 5);
this.label1.Name = "label1";
this.label1.Size = new System.Drawing.Size(59, 12);
this.label1.TabIndex = 0;
this.label1.Text = "更新日期:";
//
// dateTimePicker1
//
this.dateTimePicker1.CustomFormat = "yyyy年MM月dd日 HH:mm:ss";
this.dateTimePicker1.Format = System.Windows.Forms.DateTimePickerFormat.Custom;
this.dateTimePicker1.Location = new System.Drawing.Point(62, 0);
this.dateTimePicker1.Name = "dateTimePicker1";
this.dateTimePicker1.Size = new System.Drawing.Size(160, 21);
this.dateTimePicker1.TabIndex = 1;
this.dateTimePicker1.Value = new System.DateTime(2008, 3, 7, 12, 0, 0, 0);
//
// Form1
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(222, 21);
this.Controls.Add(this.dateTimePicker1);
this.Controls.Add(this.label1);
this.Name = "Form1";
this.Text = "示例.";
this.ResumeLayout(false);
this.PerformLayout(); } #endregion private System.Windows.Forms.Timer timer1;
private System.Windows.Forms.Label label1;
private System.Windows.Forms.DateTimePicker dateTimePicker1; public DEMO()
{
InitializeComponent();
} private void timer1_Tick(object sender, EventArgs e)
{
if (DateTime.Now.CompareTo(this.dateTimePicker1.Value) >= 0)
{
MessageBox.Show("执行自动更新");
}
}
}
}