DriveInfo.GetDrives使用错误备忘
来源:互联网 发布:windows live安装出错 编辑:程序博客网 时间:2024/06/05 20:51
DriveInfo[] allDrives = DriveInfo.GetDrives();foreach (DriveInfo info in allDrives){ if (info.DriveFormat == "FAT") { //Do something... }}
错误提示
未处理的异常: System.IO.IOException: 设备未就绪。
在 System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath)
在 System.IO.__Error.WinIODriveError(String driveName, Int32 errorCode)
在 System.IO.DriveInfo.get_DriveFormat()
在 DriveInfoHelper.Program.Main(String[] args)
改正,访问设备的属性前要判断设备是否就绪。
DriveInfo[] allDrives = DriveInfo.GetDrives();foreach (DriveInfo info in allDrives){ if (info.IsReady && info.DriveFormat == "FAT") { //Do something... }}
0 0
- DriveInfo.GetDrives使用错误备忘
- DriveInfo 类
- DriveInfo 类
- DriveInfo类
- C# DriveInfo 读取驱动器出现的错误提示排除方法,原来超幼稚!
- 使用备忘
- 备忘: HTTP错误码
- [备忘]SIGPIPE错误
- OpenGL 学习错误备忘
- tomcat配置错误备忘
- fortran 错误提示备忘
- pdns 错误解决[备忘]
- javascript错误备忘
- Maven3.5.0错误备忘
- kickstart 常见错误[备忘]
- 温故知新--DriveInfo类
- VC开发常见错误备忘
- nginx 编译错误解决方法 [备忘]
- [人工智能]基于Spark机器学习之决策树实现
- Add Two Numbers II
- Elasticsearch 自动补齐建议
- (18)Java学习笔记——多线程01
- 数据算法之快速排序(quickSort)的Java实现
- DriveInfo.GetDrives使用错误备忘
- Win10 Python 2.7.7 安装Scrapy
- C# 类型转换(知识要点归纳总结)
- 基于Ubuntu系统搭建以太坊go-ethereum源码的开发环境
- Android studio————Gradle基础语法
- hibernate与mybatis的区别
- CListBox中怎么样默认选中第一行的数据?
- angular 中的 DOM 操作
- CSS3盒相关样式读后感