DriveInfo.IsReady プロパティとは? わかりやすく解説

Weblio 辞書 > コンピュータ > .NET Framework クラス ライブラリ リファレンス > DriveInfo.IsReady プロパティの意味・解説 

DriveInfo.IsReady プロパティ

メモ : このプロパティは、.NET Framework version 2.0新しく追加されたものです。

ドライブ準備ができているかどうかを示す値を取得します

名前空間: System.IO
アセンブリ: mscorlib (mscorlib.dll 内)
構文構文

解説解説

IsReady は、ドライブ準備ができているかどうか示します。たとえば、CD ドライブCD入っているか、またはリムーバブル ストレージ デバイス読み取り/書き込み操作準備ができているかを示しますドライブ準備ができているかどうかテストしなかった場合に、ドライブ準備ができていないと、DriveInfo を使用してドライブ照会したときに IOException が発生します

使用例使用例

DriveInfo クラス使用して現在のシステムの全ドライブに関する情報表示する方法次のコード例示します

Imports System
Imports System.IO

Class Test
    Public Shared Sub Main()
        Dim allDrives() As DriveInfo = DriveInfo.GetDrives()

        Dim d As DriveInfo
        For Each d In allDrives
            Console.WriteLine("Drive {0}", d.Name)
            Console.WriteLine("  File type: {0}",
 d.DriveType)
            If d.IsReady = True Then
                Console.WriteLine("  Volume label: {0}",
 d.VolumeLabel)
                Console.WriteLine("  File system: {0}",
 d.DriveFormat)
                Console.WriteLine( _
                    "  Available space to current user:{0, 15}
 bytes", _
                    d.AvailableFreeSpace)

                Console.WriteLine( _
                    "  Total available space:          {0, 15}
 bytes", _
                    d.TotalFreeSpace)

                Console.WriteLine( _
                    "  Total size of drive:            {0, 15}
 bytes ", _
                    d.TotalSize)
            End If
        Next
    End Sub
End Class
'This code produces output similar to the following:
'
'Drive A:\
'  File type: Removable
'Drive C:\
'  File type: Fixed
'  Volume label: 
'  File system: FAT32
'  Available space to current user:     4770430976 bytes
'  Total available space:               4770430976 bytes
'  Total size of drive:                10731683840 bytes 
'Drive D:\
'  File type: Fixed
'  Volume label: 
'  File system: NTFS
'  Available space to current user:    15114977280 bytes
'  Total available space:              15114977280 bytes
'  Total size of drive:                25958948864 bytes 
'Drive E:\
'  File type: CDRom
'
'The actual output of this code will vary based on machine and the permissions
'granted to the user executing it.
using System;
using System.IO;

class Test
{
    public static void Main()
    {
        DriveInfo[] allDrives = DriveInfo.GetDrives();

        foreach (DriveInfo d in allDrives)
        {
            Console.WriteLine("Drive {0}", d.Name);
            Console.WriteLine("  File type: {0}", d.DriveType);
            if (d.IsReady == true)
            {
                Console.WriteLine("  Volume label: {0}", d.VolumeLabel);
                Console.WriteLine("  File system: {0}", d.DriveFormat);
                Console.WriteLine(
                    "  Available space to current user:{0, 15} bytes",
 
                    d.AvailableFreeSpace);

                Console.WriteLine(
                    "  Total available space:          {0, 15} bytes",
                    d.TotalFreeSpace);

                Console.WriteLine(
                    "  Total size of drive:            {0, 15} bytes "
,
                    d.TotalSize);
            }
        }
    }
}
/* 
This code produces output similar to the following:

Drive A:\
  File type: Removable
Drive C:\
  File type: Fixed
  Volume label: 
  File system: FAT32
  Available space to current user:     4770430976 bytes
  Total available space:               4770430976 bytes
  Total size of drive:                10731683840 bytes 
Drive D:\
  File type: Fixed
  Volume label: 
  File system: NTFS
  Available space to current user:    15114977280 bytes
  Total available space:              15114977280 bytes
  Total size of drive:                25958948864 bytes 
Drive E:\
  File type: CDRom

The actual output of this code will vary based on machine and
 the permissions
granted to the user executing it.
*/
プラットフォームプラットフォーム
バージョン情報バージョン情報
参照参照


このページでは「.NET Framework クラス ライブラリ リファレンス」からDriveInfo.IsReady プロパティを検索した結果を表示しています。
Weblioに収録されているすべての辞書からDriveInfo.IsReady プロパティを検索する場合は、下記のリンクをクリックしてください。
 全ての辞書からDriveInfo.IsReady プロパティを検索

英和和英テキスト翻訳>> Weblio翻訳
英語⇒日本語日本語⇒英語
  

辞書ショートカット

すべての辞書の索引

DriveInfo.IsReady プロパティのお隣キーワード
検索ランキング

   

英語⇒日本語
日本語⇒英語
   



DriveInfo.IsReady プロパティのページの著作権
Weblio 辞書 情報提供元は 参加元一覧 にて確認できます。

   
日本マイクロソフト株式会社日本マイクロソフト株式会社
© 2024 Microsoft.All rights reserved.

©2024 GRAS Group, Inc.RSS