社区
API
帖子详情
怎样编程获取另一微机的时钟(非net time方法)?
思考
2003-03-31 08:25:38
在win98下怎样编程获取另一微机的时钟,不用 net time方法
有api函数吗?
...全文
47
18
打赏
收藏
怎样编程获取另一微机的时钟(非net time方法)?
在win98下怎样编程获取另一微机的时钟,不用 net time方法 有api函数吗?
复制链接
扫一扫
分享
转发到动态
举报
写回复
配置赞助广告
用AI写文章
18 条
回复
切换为时间正序
请发表友善的回复…
发表回复
打赏红包
BAYERN
2003-04-03
打赏
举报
回复
等着看。。。。。。。。。。。。。
思考
2003-04-03
打赏
举报
回复
再up
lxcc
2003-04-02
打赏
举报
回复
option Explicit
'
'
private Declare Function NetRemoteTOD Lib "Netapi32.dll" ( _
tServer as Any, pBuffer as Long) as Long
'
private Type SYSTEMTIME
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 Type
'
private Type TIME_ZONE_INFORMATION
Bias as Long
StandardName(32) as Integer
StandardDate as SYSTEMTIME
StandardBias as Long
DaylightName(32) as Integer
DaylightDate as SYSTEMTIME
DaylightBias as Long
End Type
'
private Declare Function GetTimeZoneInformation Lib "kernel32" (lpTimeZoneInformation as TIME_ZONE_INFORMATION) as Long
'
private Declare Function NetApiBufferFree Lib "Netapi32.dll" (byval lpBuffer as Long) as Long
'
private Type TIME_OF_DAY_INFO
tod_elapsedt as Long
tod_msecs as Long
tod_hours as Long
tod_mins as Long
tod_secs as Long
tod_hunds as Long
tod_timezone as Long
tod_tinterval as Long
tod_day as Long
tod_month as Long
tod_year as Long
tod_weekday as Long
End Type
'
private Declare Sub CopyMemory Lib "kernel32" Alias "RtlMoveMemory" (Destination as Any, Source as Any, byval Length as Long)
'
'
public Function getRemoteTOD(byval strServer as string) as date
'
Dim result as date
Dim lRet as Long
Dim tod as TIME_OF_DAY_INFO
Dim lpbuff as Long
Dim tServer() as Byte
'
tServer = strServer & vbNullChar
lRet = NetRemoteTOD(tServer(0), lpbuff)
'
If lRet = 0 then
CopyMemory tod, byval lpbuff, len(tod)
NetApiBufferFree lpbuff
result = DateSerial(tod.tod_year, tod.tod_month, tod.tod_day) + _
TimeSerial(tod.tod_hours, tod.tod_mins - tod.tod_timezone, tod.tod_secs)
getRemoteTOD = result
else
Err.Raise Number:=vbObjectError + 1001, _
Description:="cannot get remote TOD"
End If
'
End Function
要运行该程序,通过如下方式调用。
private Sub Command1_Click()
Dim d as date
'
d = GetRemoteTOD("your NT server name goes here")
MsgBox d
End Sub
lxcc
2003-04-02
打赏
举报
回复
up
思考
2003-04-02
打赏
举报
回复
up
flowerboyhgc
2003-04-02
打赏
举报
回复
up
思考
2003-04-02
打赏
举报
回复
谢谢,楼上的是指win2000吧,那在win98下呢?
思考
2003-04-02
打赏
举报
回复
没有sql-server,只想取对方计算机时钟,不想校对本机时钟
cbr7619
2003-04-02
打赏
举报
回复
如果对方机上有sql-server的话,
可用getdate()函数使得两机的时间一致
思考
2003-04-02
打赏
举报
回复
谢谢,可是在win98下不行啊,找不到 DLL 入口点 NetRemoteTOD in Netapi32.dll
NowCan
2003-04-02
打赏
举报
回复
98???
_131_
2003-03-31
打赏
举报
回复
打电话去问问,然后写到程序里面!
思考
2003-03-31
打赏
举报
回复
up
watt
2003-03-31
打赏
举报
回复
i don't know.
lxcc
2003-03-31
打赏
举报
回复
up
思考
2003-03-31
打赏
举报
回复
要求对方的计算机不能安装任何软件,如winsock
NowCan
2003-03-31
打赏
举报
回复
'NETAPI32
Private Declare Function NetRemoteTOD Lib "NETAPI32.DLL" (ByVal UncServerName As String, ByVal BufferPtr As String) As Long
思考
2003-03-31
打赏
举报
回复
看来还得用 Net Time \\计算机名 >a.txt
5555555555555555555 !!!
电子
时钟
的设计及程序.doc
电子
时钟
的设计及程序 一.设计目的: 1. 理解掌握定时/计数器和中断的使用
方法
。 2. 掌握
微机
常用的输入输出方式及接口技术。 3. 掌握一定的汇编语言知识,培养自己的动手操作能力。 4. 学习程序设计的基本思路和...
汇编语言课程设计——————电子
时钟
的设计.doc
西安工业大学课程设计用纸 课程名称:汇编语言程序设计 课程英文名称:PROGRAMMING BY ASSEMBLE LANGUAGE 一.设计目的: 1. 理解掌握定时/计数器和中断的使用
方法
。 2. 掌握
微机
常用的输入输出方式及接口技术。 3. ...
汇编INT中断和I/O指令【
获取
主板
时钟
】
中断是一种使CPU挂起正在执行的程序去处理特殊的事件的操作,处理特殊时间的服务程序称为中断程序,即处理中断的程序。...这里编写一个实地址模式下
获取
主板CMOS实时
时钟
,并在指定位置显示的汇
编程
序。
时钟
、SysTick定时器、PWM、ADC
时钟
基本概念1)
时钟
是嵌入式系统的脉搏,处理器内核在
时钟
驱动下完成指令执行,状态变换等动作,外设部件在
时钟
的驱动下完成各种工作,例如:串口数据的发送、AD转换、定时器计数等因此
时钟
对于计算机系统是至关...
51单片机DS1302实时
时钟
一、DS1302介绍 DS1302是由美国DALLAS公司推出的具有涓细电流充电能力的低功耗实时
时钟
芯片。它可以对年、月、日、周、时、分、秒进行计时,且具有闰年补偿等多种功能。 RTC(Real
Time
Clock):实时
时钟
,是-种...
API
1,486
社区成员
23,279
社区内容
发帖
与我相关
我的任务
API
VB API
复制链接
扫一扫
分享
社区描述
VB API
社区管理员
加入社区
获取链接或二维码
近7日
近30日
至今
加载中
查看更多榜单
社区公告
暂无公告
试试用AI创作助手写篇文章吧
+ 用AI写文章