社区
API
帖子详情
怎样编程获取另一微机的时钟(非net time方法)?
思考
2003-03-31 08:25:38
在win98下怎样编程获取另一微机的时钟,不用 net time方法
有api函数吗?
...全文
50
18
打赏
收藏
怎样编程获取另一微机的时钟(非net time方法)?
在win98下怎样编程获取另一微机的时钟,不用 net time方法 有api函数吗?
复制链接
扫一扫
分享
转发到动态
举报
AI
作业
写回复
配置赞助广告
用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 !!!
TM.rar_clock_
微机
时钟
利用DOS提供的中断调用功能和BIOS系统调用功能,利用
微机
本身的中断向量表,实现对
微机
的
时钟
的管理操作。让
微机
在显示器上模拟显示一个
时钟
。
单片机LED电子
时钟
单片机LED电子
时钟
原理图及源代码,含有程序流程开发,以便于更好的写设计论文
实时
时钟
1602 显示代码
单片机 1602 实
时钟
开发 代码 HD44780 2004液晶类似
带
时钟
显示的闹钟 单片机
带
时钟
显示的闹钟 单片机 带市中显示的闹钟 单片机
使用51单片机设计的花样流水灯以及可调实时温度
时钟
.zip
计算机类毕业设计源码
API
1,488
社区成员
23,276
社区内容
发帖
与我相关
我的任务
API
VB API
复制链接
扫一扫
分享
社区描述
VB API
社区管理员
加入社区
获取链接或二维码
近7日
近30日
至今
加载中
查看更多榜单
社区公告
暂无公告
试试用AI创作助手写篇文章吧
+ 用AI写文章