Environment.GetLogicalDrives メソッドとは? わかりやすく解説

Weblio 辞書 > コンピュータ > .NET Framework クラス ライブラリ リファレンス > Environment.GetLogicalDrives メソッドの意味・解説 

Environment.GetLogicalDrives メソッド

現在のコンピュータ論理ドライブの名前を格納している文字列配列返します

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

Public Shared Function GetLogicalDrives
 As String()
Dim returnValue As String()

returnValue = Environment.GetLogicalDrives
public static string[] GetLogicalDrives
 ()
public:
static array<String^>^ GetLogicalDrives ()
public static String[] GetLogicalDrives ()
public static function GetLogicalDrives
 () : String[]

戻り値
各要素論理ドライブの名前を格納している文字列配列。たとえば、コンピュータハード ディスク ドライブ最初論理ドライブ場合返される先頭要素は "C:\" です。

例外例外
例外種類条件

IOException

I/O エラー発生しました

SecurityException

呼び出し元に必要なアクセス許可がありません。

使用例使用例
' Sample for the Environment.GetLogicalDrives method
Imports System

Class Sample
   Public Shared Sub Main()
      Console.WriteLine()
      Dim drives As [String]() = Environment.GetLogicalDrives()
      Console.WriteLine("GetLogicalDrives: {0}", [String].Join(",
 ", drives))
   End Sub 'Main
End Class 'Sample
'
'This example produces the following results:
'
'GetLogicalDrives: A:\, C:\, D:\
'
// Sample for the Environment.GetLogicalDrives method
using System;

class Sample 
{
    public static void Main()
 
    {
    Console.WriteLine();
    String[] drives = Environment.GetLogicalDrives();
    Console.WriteLine("GetLogicalDrives: {0}", String.Join(", ",
 drives));
    }
}
/*
This example produces the following results:

GetLogicalDrives: A:\, C:\, D:\
*/
// Sample for the Environment::GetLogicalDrives method
using namespace System;
int main()
{
   Console::WriteLine();
   array<String^>^drives = Environment::GetLogicalDrives();
   Console::WriteLine( "GetLogicalDrives: {0}", String::Join( ", ",
 drives ) );
}

/*
This example produces the following results:

GetLogicalDrives: A:\, C:\, D:\
*/
// Sample for the Environment.GetLogicalDrives method
import System.*;

class Sample
{
    public static void main(String[]
 args)
    {
        Console.WriteLine();
        String drives[] = Environment.GetLogicalDrives();
        Console.WriteLine("GetLogicalDrives: {0}", String.Join(", ",
 drives));
    } //main
} //Sample

/*
This example produces the following results:

GetLogicalDrives: A:\, C:\, D:\
*/
.NET Framework のセキュリティ.NET Frameworkセキュリティ
プラットフォームプラットフォーム
バージョン情報バージョン情報
参照参照


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

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

辞書ショートカット

すべての辞書の索引

「Environment.GetLogicalDrives メソッド」の関連用語

Environment.GetLogicalDrives メソッドのお隣キーワード
検索ランキング

   

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



Environment.GetLogicalDrives メソッドのページの著作権
Weblio 辞書 情報提供元は 参加元一覧 にて確認できます。

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

©2025 GRAS Group, Inc.RSS