我已经知道了获取远程服务器时间了但是不知道如何调用setlocaltime 设置本地时间。
就是如何定义该函数了。谢谢各位VB高手指点迷津。

解决方案 »

  1.   

    Type SYSTEMTIME ' 16 Bytes 
    wYear As Integer
    wMonth As Integer
    wDayOfWeek As Integer
    wDay As Integer
    wHour As Integer
    wMinute As Integer
    wSecond As Integer
    wMilliseconds As Integer
    End TypeDeclare Function SetLocalTime Lib "kernel32" Alias "SetLocalTime" (lpSystemTime As SYSTEMTIME) As LongPrivate Sub Command1_Click()
      Dim stm as SYSTEMTIME
      with stm     //初始化系统时间结构
       .wYear =...
       .wMonth =...
       ...
      end with
      rt=SetLocalTime(stm)
    ENd Sub试一下