尝试了一下,如果需要使用代码,似乎在程序退出后,还是可以更改时间代码如下:Private Type OFSTRUCT cBytes As Byte fFixedDisk As Byte nErrCode As Integer Reserved1 As Integer Reserved2 As Integer szPathName As String * 128 End TypePrivate Const OF_SHARE_EXCLUSIVE = &H10Private Declare Function OpenFile Lib "kernel32" (ByVal lpFileName As String, lpReOpenBuff As OFSTRUCT, ByVal wStyle As Long) As LongPrivate Sub Command1_Click() Dim m As OFSTRUCT
OpenFile "c:\windows\system32\timedate.cpl", m, OF_SHARE_EXCLUSIVE
End Sub 如果当前将该文件打开,则用户无法更改系统时间(通过控制面版或者是桌面右下角双击)建议 系统在运行时,Shell一个net time命令,将某个服务器的时间(其他用户无权操作)更新为系统时间,然后再将控制面版锁死
cBytes As Byte
fFixedDisk As Byte
nErrCode As Integer
Reserved1 As Integer
Reserved2 As Integer
szPathName As String * 128
End TypePrivate Const OF_SHARE_EXCLUSIVE = &H10Private Declare Function OpenFile Lib "kernel32" (ByVal lpFileName As String, lpReOpenBuff As OFSTRUCT, ByVal wStyle As Long) As LongPrivate Sub Command1_Click()
Dim m As OFSTRUCT
OpenFile "c:\windows\system32\timedate.cpl", m, OF_SHARE_EXCLUSIVE
End Sub
如果当前将该文件打开,则用户无法更改系统时间(通过控制面版或者是桌面右下角双击)建议
系统在运行时,Shell一个net time命令,将某个服务器的时间(其他用户无权操作)更新为系统时间,然后再将控制面版锁死