Пример #1
0
 private static DriveInfo[] UnixGetDrives()
 {
     DriveInfo[] array = null;
     try
     {
         using (StreamReader streamReader = DriveInfo.TryOpen("/proc/sys/kernel/ostype"))
         {
             if (streamReader != null)
             {
                 string a = streamReader.ReadLine();
                 if (a == "Linux")
                 {
                     array = DriveInfo.LinuxGetDrives();
                 }
             }
         }
         if (array != null)
         {
             return(array);
         }
     }
     catch (Exception)
     {
     }
     return(new DriveInfo[]
     {
         new DriveInfo(DriveInfo._DriveType.GenericUnix, "/", "unixfs")
     });
 }