关于SetTimeZoneInformation设置时区的API的使用,该如何解决
关于SetTimeZoneInformation设置时区的API的使用
MSDN上“An application must have the SE_TIME_ZONE_NAME privilege for this function to succeed. This privilege is disabled by default. Use the AdjustTokenPrivileges function to enable the privilege before calling SetTimeZoneInformation, and then to disable the privilege after the SetTimeZoneInformation call. For more information, see Running with Special Privileges.”
我只调用了SetTimeZoneInformation这个函数,没有调用获取权限的函数,为何还是可以设置成功呢?什么情况下会出现没有权限呢?
------解决思路----------------------
比如你用非Administrators组的用户登录时。
MSDN上“An application must have the SE_TIME_ZONE_NAME privilege for this function to succeed. This privilege is disabled by default. Use the AdjustTokenPrivileges function to enable the privilege before calling SetTimeZoneInformation, and then to disable the privilege after the SetTimeZoneInformation call. For more information, see Running with Special Privileges.”
我只调用了SetTimeZoneInformation这个函数,没有调用获取权限的函数,为何还是可以设置成功呢?什么情况下会出现没有权限呢?
------解决思路----------------------
比如你用非Administrators组的用户登录时。