有没有办法检查司机是否准备好?
因为我列出了所有目录,例如当它到达 DVD 时,我得到一个异常,说驱动程序没有准备好。
非常感谢
@{
try
{
//Resgata todos os drivers Lógicos do Sistema
string[] drives = System.IO.Directory.GetLogicalDrives();
Response.Write("<ul class=\"jqueryFileTree\" style=\"display: none;\">\n");
//Itera sobre cada driver no array
foreach(string drive in directoryEntries) {
//Para cada driver cria um LI A
Response.Write("\t<li class=\"directory collapsed\"><a href=\"#\" rel=\"" + drive + "\">" + drive + "</a></li>\n");
//Resgata subDiretórios de cada driver
string[] directoryEntries = System.IO.Directory.GetFileSystemEntries(drive);
}
}
catch (Exception)
{
throw;
}
}
多谢