简体   繁体   English

如何获取逻辑驱动器列表?

[英]How to get a list of logical drives?

How can I get list of logical drives in C++? 如何获得C ++中的逻辑驱动器列表? I know that for Windows in C# is a function System.IO.DriveInfo.GetDrives() , but that's Windows only solution. 我知道对于C#中的Windows,是一个函数System.IO.DriveInfo.GetDrives() ,但这是Windows唯一的解决方案。 Is there any multiplatform way? 有什么跨平台的方式吗? I went through a Boost::Filesystem documentation, but found nothing. 我浏览了Boost :: Filesystem文档,但未找到任何内容。

C# and .Net are not just for Windows any more. C#和.Net不再仅适用于Windows。 The DriveInfo Class is part of .NET Standard 2.0, and so is available cross-platform with .NET Core 2.0. DriveInfo类是.NET Standard 2.0的一部分,因此可以与.NET Core 2.0跨平台使用。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM