在 Windows 上使用 C 或 C++ 更改系统时间
Change system time using C or C++ on Windows
如何使用 C 或 C++ 更改 Windows 上的系统时间?
我搜索了互联网,但找不到它。
点击此链接 : http://learnhacking.in/c-program-to-set-change-current-system-date/
但它不起作用。
在Windows中,您可以通过GetSystemTime(以及一些不同的C/C++标准库函数)获取时间,并通过SetSystemTime设置时间
请注意,您需要在 Windows 中具有某些权限才能更改时间,因此如果您没有这些权限,则需要让管理员授予您更多权限。
您可以通过包含 windows.h 标头并调用 SetSystemTime(...) 函数来设置它。
相关文章:
- C++,系统无法执行指定的程序
- 在UNIX系统中使用DIR查找文件的字节大小
- 错误处理.将系统错误代码映射到泛型
- 当系统的卷被修改时,如何修改WASAPI环回捕获卷
- 有什么好的方法可以让系统调用代理允许在单元测试中进行模拟
- 在C++游戏中与库存系统作斗争
- 文件系统:复制功能的速度秘诀是什么
- c++17文件系统::recursive_directory迭代器()在mac上没有给出这样的目录,但在windows上
- 在gtest.中使用fff.h模拟系统API
- 如何制作无限制照明系统
- 系统.将数组移交给c#中动态加载的c++DLL时发生AccessViolationException
- 如何传递多个 std::文件系统选项?
- 遍历顺序由 std::文件系统directory_iterator给出
- C++系统找不到指定的文件错误
- 系统参数信息A 与 SPI_GETMOUSE 返回 0
- libstdc++ 文件系统中未初始化的用法?
- 如何在ECS框架中更新组件数据和通知系统
- boost::文件系统::recursive_directory_iterator多线程安全
- 如果整个应用程序是虚拟映射的,为什么 new 会进行系统调用?
- SFML 碰撞永远不会在我的系统中注册