 
										
					
	 
										
					
	 
										
					
	 2006-04-10 22:33
	    2006-04-10 22:33
   2006-04-10 22:34
	    2006-04-10 22:34
  用Timer 控件
 2006-04-11 09:35
	    2006-04-11 09:35
   2006-04-11 09:36
	    2006-04-11 09:36
  大哥理解错了,我意思是在分机上取得主机的时间啊,在.net平台上能用rdo吗
 2006-04-11 22:58
	    2006-04-11 22:58
  

看这个对你又没有用~~
using System;
using System.Drawing;
using System.Collections;
using System.ComponentModel;
using System.Windows.Forms;
using System.Data;
using System.Runtime.InteropServices;
namespace 系统时间
{
 省略。。。。。。。。。。。。。。。
  /// 应用程序的主入口点。
  /// </summary>
  [STAThread]
  static void Main() 
  {
   Application.Run(new Form1());
  }
  [DllImport("Kernel32.dll")]
  public static extern void GetLocalTime(SystemTime st);
  [DllImport("Kernel32.dll")]
  public static extern void SetLocalTime(SystemTime st);
  [StructLayout(LayoutKind.Sequential)]
   public class SystemTime
  {
   public ushort wYear;
   public ushort wMonth;
   public ushort wDayOfWeek;
   public ushort wDay;
   public ushort wHour;
   public ushort wMinute;
   public ushort wSecond;
   public ushort wMillsecond;
  }
  private void button1_Click(object sender, System.EventArgs e)
  {
   SystemTime st =new SystemTime();
   st.wYear=(ushort)this.dateTimePicker1.Value.Year;
   st.wMonth=(ushort)this.dateTimePicker1.Value.Month;
   st.wDay=(ushort)this.dateTimePicker1.Value.Day;
   st.wHour=(ushort)this.dateTimePicker1.Value.Hour;
   st.wMinute=(ushort)this.dateTimePicker1.Value.Minute;
   st.wSecond=(ushort)this.dateTimePicker1.Value.Second;
   SetLocalTime(st);
  }
  private void timer1_Tick(object sender, System.EventArgs e)
  {
   SystemTime st =new SystemTime();
   GetLocalTime(st);
  label1.Text=Convert.ToString(DateTime.Now.TimeOfDay);
  }
  private void Form1_Load(object sender, System.EventArgs e)
  {
   this.dateTimePicker1.Value=DateTime.Now;
   
  }
 }
}

 2006-04-12 16:56
	    2006-04-12 16:56
   这代码取得的还是本地机器上的时间啊,我的意思是假如通过ODBC连接的远程SQL数据库,怎么取得安装SQL数据库计算机(服务器)上的时间,以前在VB6.0中我是用RDO对象取得的,但是怎么在.NET平台上用c#代码取得啊,还请高手多帮帮忙
这代码取得的还是本地机器上的时间啊,我的意思是假如通过ODBC连接的远程SQL数据库,怎么取得安装SQL数据库计算机(服务器)上的时间,以前在VB6.0中我是用RDO对象取得的,但是怎么在.NET平台上用c#代码取得啊,还请高手多帮帮忙										
					
	 2006-04-13 18:04
	    2006-04-13 18:04
  没有人有办法吗?
 2006-04-14 18:34
	    2006-04-14 18:34
   2006-04-17 16:27
	    2006-04-17 16:27
   2006-04-19 15:10
	    2006-04-19 15:10