Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
有没有一种规范的方法来检查 Windows 中文件的大小?谷歌搜索给我带来了FindFirstFile 和GetFileSizeEx但没有明确的赢家。并且必须总是调用 GetLastError 吗?
如果您只想要尺寸,那GetFileSizeEx是明显的赢家。是的,FindFirstFile也可以完成这项工作,但它确实是为了其他目的,除非你需要做其他事情,否则它的使用可能会误导或混淆读者。
GetFileSizeEx
FindFirstFile