使用C#计算系统中可用的驱动器数(分区) [英] Count the number of drives(Partition) available in system using C#
本文介绍了使用C#计算系统中可用的驱动器数(分区)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
如何使用C#计算系统中可用的驱动器(分区)数量?
示例 -
假设有4个在我的系统中分区我只需单击一个按钮,我必须在消息框中输入4并且还有驱动器的名称?
解决方案
在.NET中轻松访问,使用DriveInfo
类
http://msdn.microsoft.com/en-us/library/system.io.driveinfo.getdrives.aspx [ ^ ]
http://msdn.microsoft.com/en-us/library/system.io.directory.getlogicaldrives。 aspx [ ^ ]
how to Count the number of drives(partition) available in the system using C#?
example -
suppose there are 4 partition in my system i simply click on a button and i must got 4 in message box and also the name of the drives?解决方案Easy way to access in .NET, useDriveInfo
class
http://msdn.microsoft.com/en-us/library/system.io.driveinfo.getdrives.aspx[^]
http://msdn.microsoft.com/en-us/library/system.io.directory.getlogicaldrives.aspx[^]
这篇关于使用C#计算系统中可用的驱动器数(分区)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文